Dimmitry007 Posted February 17, 2015 Share Posted February 17, 2015 Hello I'm working in onduty script That show some thing says OnDuty in admin head the problem is that I want to disable it. But I don't know Here is my code function adminduty(player) giveWeapon (player,26,30) setPlayerNametagText (player,"onDuty") setPedArmor (player,100) setPedSkin (player,260) end addCommandHandler("aduty",adminduty) I want to disable it by typing off duty please help Peace! Link to comment
Callum Posted February 17, 2015 Share Posted February 17, 2015 Just reverse what you did: function offDuty(player) takeWeapon(player,26,30) setPlayerNametagText(player,getPlayerName(player)) setPedArmor(player,0) end addCommandHandler("offduty",offDuty) However restoring their skin will take a little more work, e.g. storing their original skin to a table. Link to comment
xeon17 Posted February 17, 2015 Share Posted February 17, 2015 function adminduty(player) if getElementData(player,"duty") then setPlayerNametagText (player,"") setElementModel(player,0) takeWeapon(player,26,30) outputChatBox("You aren't on Duty anymore!",player) else outputChatBox("You are on Duty now!",player) setElementData(player,"duty",true) giveWeapon (player,26,30) setPlayerNametagText (player,"onDuty") setPedArmor (player,100) setElementModel (player,260) end end end addCommandHandler("aduty",adminduty) Link to comment
Dimmitry007 Posted February 17, 2015 Author Share Posted February 17, 2015 Can I use SetPlayerNameTagText, ("player",False) ? Link to comment
Dimmitry007 Posted February 17, 2015 Author Share Posted February 17, 2015 Anyway thanks! Link to comment
JR10 Posted February 17, 2015 Share Posted February 17, 2015 Can I use SetPlayerNameTagText, ("player",False) ? It's setPlayerNameTagText, the s is small. Why is there a comma after the function name. The player argument should not be a string. And no, you can't do that, you have to specify a new name tag text. Link to comment
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