Jump to content

Help set rate


Big Smoker

Recommended Posts

I need a help in this script that I had saved only that it's half bugged and I can not adjust it and it's set rate for MTA DAYZ that you put a number Ex: (I put number 55, all with number 55 will appear on the GPS) Appears in the GPS only to disable the GPS does not work I wanted to put the number 0 to deactivate the set rate. Thank you in advance

- Open the window

SetGPSRateWindow = guiCreateWindow(0.42,0.45,0.08,0.13,"Set GPS Rate",true)
guiWindowSetSizable(SetGPSRateWindow,false)
guiSetVisible(SetGPSRateWindow,false)
GPSRate = guiCreateEdit(0.10,0.25,0.81,0.25,"",true,SetGPSRateWindow)
SetGPSRate = guiCreateButton(0.10,0.61,0.81,0.29,"Set",true,SetGPSRateWindow)
guiSetFont(SetGPSRate,"default-bold-small")
guiSetProperty(SetGPSRateWindow,"AlwaysOnTop","True")

- Function setting rate

addEventHandler("onClientGUIClick",getResourceRootElement(getThisResource()),function()
  if source == SetGPSRate then
    rate = guiGetText(GPSRate)
    if rate ~= "" and tonumber(rate) then
      guiSetVisible(SetGPSRateWindow,false)
      setElementData(getLocalPlayer(),"GPSChannel",rate)
    else
      outputChatBox("Type a number!")
    end
  end
end)

Att

~ Baido

 

Edited by felipebaidoloko
Translation
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...