Scripting Posted February 26, 2012 Posted February 26, 2012 This a code to set can t fire another player but my problem he set another player and localPlayer can fire and don t set just localPlayer can fire ,fix problem and thx client-side: if getLocalPlayer () then toggleControl ( "fire", true ) else toggleControl ( "fire", false ) end
MIKI785 Posted February 26, 2012 Posted February 26, 2012 Don't understand what you need... if getLocalPlayer () That will always pass, because getLocalPlayer has always value, so player can always fire.
Scripting Posted February 26, 2012 Author Posted February 26, 2012 Ok,give me a another solution to fix that??!
TAPL Posted February 26, 2012 Posted February 26, 2012 another solution for what!!! We don't understand what you're trying to do. Explain what you want so we can help you.
Scripting Posted February 26, 2012 Author Posted February 26, 2012 addCommandHandler("unfire",root, function () toggleControl ( "fire", false ) end ) this a Command to set player can t fire, but if i use command me too i can t fire i want fix it and thanks
TAPL Posted February 26, 2012 Posted February 26, 2012 addCommandHandler("unfire", function () toggleControl("fire", false) end)
Kenix Posted February 26, 2012 Posted February 26, 2012 scripter_new,2 argument addCommandHandler is function ( not element ).
Scripting Posted February 26, 2012 Author Posted February 26, 2012 How i can set just localPlayer used Command can fire!! addCommandHandler("unfire", function () toggleControl("fire", false) end)
MIKI785 Posted February 26, 2012 Posted February 26, 2012 You're doing it client side.. it's LocalPlayer.. see wiki.
Kenix Posted February 26, 2012 Posted February 26, 2012 scripter_new,What you need create? All players can't fire if you use /unfire ? or what
TAPL Posted February 26, 2012 Posted February 26, 2012 dude it's client side while this means localPlayer ! if you want can fire then change false to true like this toggleControl("fire", true)
Scripting Posted February 26, 2012 Author Posted February 26, 2012 All players can't fire if you use /unfire is true,you don't understand me if for exemple me i used /unfire me too can t fire; i want me a help set all player can t fire just me
drk Posted February 26, 2012 Posted February 26, 2012 Server-side: addCommandHandler('unfire', function(thePlayer,cmd) toggleControl(thePlayer,"fire",true) end ) Or this ( type /fire to enable / disable fire ) local control = true addCommandHandler('fire', function(thePlayer,cmd) if control then toggleControl(thePlayer,'fire',false) control = false else toggleControl(thePlayer,'fire',true) control = true end end )
Kenix Posted February 26, 2012 Posted February 26, 2012 Server addCommandHandler( 'fire', function( thePlayer,cmd ) toggleControl( thePlayer,'fire',not isControlEnabled( thePlayer,'fire' ) ) end )
Scripting Posted February 26, 2012 Author Posted February 26, 2012 ok thx you for full heeeeeeeeeeeeeeelp verrrrrrrrrrrrrrrry thankssssssssss
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