Jump to content

scorebar player color


botshara

Recommended Posts

-- /duty for police 
addCommandHandler( { "policeduty", "duty" }, 
    function( thePlayer, commandName ) 
        if exports.players:isLoggedIn( thePlayer ) then 
                        local characterID = exports.players:getCharacterID( thePlayer ) 
            if exports.factions:isPlayerInFaction( thePlayer, 1 ) then 
                        local result = exports.sql:query_assoc( "SELECT factionRank FROM character_to_factions WHERE characterID = " .. characterID ) 
                        for key, value in ipairs( result ) do 
                        local factionRank = value.factionRank 
                        if(factionRank == 1) then 
                setElementModel ( thePlayer, 71 ) 
                setPedArmor ( thePlayer, 100 ) 
                giveWeapon ( thePlayer, 3, 1 ) 
                giveWeapon ( thePlayer, 41, 100 ) 
                                setPlayerNametagColor( thePlayer, 0, 50, 255 ) 
            elseif(factionRank == 2) then 
                setElementModel ( thePlayer, 280 ) 
                setPedArmor ( thePlayer, 100 ) 
                giveWeapon ( thePlayer, 3, 1 ) 
                giveWeapon ( thePlayer, 24, 100 ) 
                giveWeapon ( thePlayer, 41, 100 ) 
                                setPlayerNametagColor( thePlayer, 0, 50, 255 ) 
            elseif(factionRank == 3) then 
                setElementModel ( thePlayer, 281 ) 
                setPedArmor ( thePlayer, 100 ) 
                giveWeapon ( thePlayer, 3, 1 ) 
                giveWeapon ( thePlayer, 24, 100 ) 
                giveWeapon ( thePlayer, 41, 100 ) 
                                setPlayerNametagColor( thePlayer, 0, 50, 255 ) 
            elseif(factionRank == 4) then 
                setElementModel ( thePlayer, 281 ) 
                setPedArmor ( thePlayer, 100 ) 
                giveWeapon ( thePlayer, 3, 1 ) 
                giveWeapon ( thePlayer, 24, 100 ) 
                giveWeapon ( thePlayer, 41, 100 ) 
                                setPlayerNametagColor( thePlayer, 0, 50, 255 ) 
            elseif(factionRank == 5) then 
                setElementModel ( thePlayer, 267 ) 
                setPedArmor ( thePlayer, 100 ) 
                giveWeapon ( thePlayer, 3, 1 ) 
                giveWeapon ( thePlayer, 24, 100 ) 
                giveWeapon ( thePlayer, 41, 100 ) 
                                setPlayerNametagColor( thePlayer, 0, 50, 255 ) 
            elseif(factionRank == 6) then 
                setElementModel ( thePlayer, 282 ) 
                setPedArmor ( thePlayer, 100 ) 
                giveWeapon ( thePlayer, 3, 1 ) 
                giveWeapon ( thePlayer, 24, 100 ) 
                giveWeapon ( thePlayer, 41, 100 ) 
                giveWeapon ( thePlayer, 25, 50 ) 
                                setPlayerNametagColor( thePlayer, 0, 50, 255 ) 
            elseif(factionRank == 7) then 
                setElementModel ( thePlayer, 283 ) 
                setPedArmor ( thePlayer, 100 ) 
                giveWeapon ( thePlayer, 3, 1 ) 
                giveWeapon ( thePlayer, 24, 100 ) 
                giveWeapon ( thePlayer, 41, 100 ) 
                giveWeapon ( thePlayer, 25, 50 ) 
                                setPlayerNametagColor( thePlayer, 0, 50, 255 ) 
                                 
                        else outputChatBox( "(( Unknown error. ))", thePlayer, 255, 0, 0 ) 
        end 
    end 
end 
end 
end 
) 
  

I have a little problem, when people write /duty then color change to blue to 15 sec and then back to white :(

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