Jump to content

Nametag admin


Dimmitry007

Recommended Posts

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

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
                    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
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

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...