Sparrow Posted December 6, 2011 Posted December 6, 2011 Hello all, Now I do this script, it's accepting servre rules before start playing IG, I got this probleme when I start the script. [2011-12-06 20:12:27] WARNING: rules\rules_s.lua:43: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil] This is server side of the script (rules_s): function acceptRules(button,state) if button == "left" and state == "up" then guiSetVisible(rulesWindow, false) showCursor(false,false) outputChatBox("You successfully accept our rules, enjoy playing.") if rulesWarningTimer then killTimer(rulesWarningTimer) rulesWarningTimer = nil end end end function inactivePlayer(status) if status == 1 then outputChatBox("Please accept our rules or you will be kicked.") rulesWarningTimer = setTimer(inactivePlayer,30000,1,2) elseif status == 2 then outputChatBox("Second Warning: Please accept our rules you will be kicked.") rulesWarningTimer = setTimer(inactivePlayer,30000,1,3) elseif status == 3 then outputChatBox("Last Warning: Please accept our rules you will be kicked.") rulesWarningTimer = setTimer(inactivePlayer,30000,1,3) elseif status == 4 then triggerServerEvent("clientKickInactivePlayer",getLocalPlayer()) end end addEvent("clientKickInactivePlayer",true) addEventHandler("clientKickInactivePlayer",root,kickInactivePlayer) Thank you for your help.
TAPL Posted December 6, 2011 Posted December 6, 2011 Hello all,Now I do this script, it's accepting servre rules before start playing IG, I got this probleme when I start the script. [2011-12-06 20:12:27] WARNING: rules\rules_s.lua:43: Bad argument @ 'addEventHandler' [Expected function at argument 3, got nil] This is server side of the script (rules_s): function acceptRules(button,state) if button == "left" and state == "up" then guiSetVisible(rulesWindow, false) showCursor(false,false) outputChatBox("You successfully accept our rules, enjoy playing.") if rulesWarningTimer then killTimer(rulesWarningTimer) rulesWarningTimer = nil end end end function inactivePlayer(status) if status == 1 then outputChatBox("Please accept our rules or you will be kicked.") rulesWarningTimer = setTimer(inactivePlayer,30000,1,2) elseif status == 2 then outputChatBox("Second Warning: Please accept our rules you will be kicked.") rulesWarningTimer = setTimer(inactivePlayer,30000,1,3) elseif status == 3 then outputChatBox("Last Warning: Please accept our rules you will be kicked.") rulesWarningTimer = setTimer(inactivePlayer,30000,1,3) elseif status == 4 then triggerServerEvent("clientKickInactivePlayer",getLocalPlayer()) end end addEvent("clientKickInactivePlayer",true) addEventHandler("clientKickInactivePlayer",root,kickInactivePlayer) Thank you for your help. is this server side? triggerServerEvent is this server side? getLocalPlayer() is this server side? guiSetVisible(rulesWindow, false)
Castillo Posted December 7, 2011 Posted December 7, 2011 This seems like part of the wiki example, I'am right? if so, I think you've messed up the client and the server side.
Sparrow Posted December 7, 2011 Author Posted December 7, 2011 Yes Castillo, it's from wiki, maybe I messed up with them
Castillo Posted December 7, 2011 Posted December 7, 2011 I suggest you this: go back to the wiki and redo the tutorial.
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