rusztamas Posted June 9, 2017 Posted June 9, 2017 Hi! As i log into my server, i recieve a lot of warnings, which are really annoying, due to a timer, who is spamming it, i don't even understand why is it spamming my debugscript, while i am not in a vehicle, just standing. function bekapcsoltOvEllenorzese(jatekos) --this is line 55 if isPedInVehicle (jatekos) == true and getElementData (jatekos, "bekapcsoltOv") == false then if isTimer(beeping) then killTimer (beeping) beeping = setTimer ( function() triggerClientEvent ("beltWarning", jatekos) bindKey (jatekos, "F5", "down", "öv") end, 1000, 0) else beeping = setTimer ( function() triggerClientEvent ("beltWarning", jatekos) bindKey (jatekos, "F5", "down", "öv") end, 1000, 0) end end end addEventHandler ("onVehicleEnter", getRootElement(), bekapcsoltOvEllenorzese) --this is line 71 I am not even in a vehicle, so i don't know why the function gets called, while it has "onVehicleEnter"...
#BrosS Posted June 9, 2017 Posted June 9, 2017 Add this to your script function ss() for k,player in ipairs(getElementsByType("player")) do bindKey (player, "F5", "down", "öv") end end addEventHandler("onResourceStart",resourceRoot,ss) addEventHandler("onPlayerJoin",root,ss) 1
pa3ck Posted June 9, 2017 Posted June 9, 2017 1 hour ago, #BrosS said: Add this to your script function ss() for k,player in ipairs(getElementsByType("player")) do bindKey (player, "F5", "down", "öv") end end addEventHandler("onResourceStart",resourceRoot,ss) addEventHandler("onPlayerJoin",root,ss) Why would you re-bind the command when somebody joins for every single player? 1
#BrosS Posted June 9, 2017 Posted June 9, 2017 25 minutes ago, pa3ck said: Why would you re-bind the command when somebody joins for every single player? I could of use only when the player join but i also used when the resource for him to see if it work 1
pa3ck Posted June 9, 2017 Posted June 9, 2017 function ss() if source and getElementType(source) == "player" then -- check if it's been called by onPlayerJoin not onResourceStart bindKey (source, "F5", "down", "öv") else for k,player in ipairs(getElementsByType("player")) do bindKey (player, "F5", "down", "öv") end end end addEventHandler("onResourceStart",resourceRoot,ss) addEventHandler("onPlayerJoin",root,ss) 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now