Jump to content

getPlayerWantedLevel >>؟


Recommended Posts

  
        function( playerWhoUses ) 
     
        if playerWhoUses == localPlayer then 
        
        for theKey,thePlayer in ipairs(getElementsByType("player")) do  
         
         
        if ( getPlayerWantedLevel ( playerWhoUses ) == 0 ) then 

WARRING : Bad argument @getPlayerWantedLevel

Link to comment
This code make no sense at all post you're whole code and it's server or client side?

server

if playerWhoUses == localPlayer then 

What does localPlayer do in server side?

what wrong now

Server Side !

addEvent("Setting",true) 
addEventHandler("Setting",root, 
  
        function(playerWhoUses) 
         
        giveWeapon ( playerWhoUses, 3, 1) 
  
        setPlayerTeam ( playerWhoUses, Police ) 
         
      end) 

Client side !

  
 addEventHandler ( 'onClientGUIClick', GUIEditor.button[1], 
        function( playerWhoUses ) 
     
        if playerWhoUses == localPlayer then 
        
        for theKey,thePlayer in ipairs(getElementsByType("player")) do  
         
        if ( getPlayerWantedLevel ( playerWhoUses ) == 0 ) then 
         
        setPlayerNametagText ( playerWhoUses, '[COP]' .. getPlayerName ( playerWhoUses ) ) 
  
        setElementData ( playerWhoUses, 'job', 'police' ) 
         
        setPedSkin ( playerWhoUses, 280 ) 
         
        triggerServerEvent("Setting",playerWhoUses,getLocalPlayer()) 
          
        outputChatBox ( '', playerWhoUses, 0, 0, 255, false ) 
  
        outputChatBox ( '', playerWhoUses, 0, 0, 255, false ) 
     
        outputChatBox ( '', playerWhoUses, 0, 0, 255, false ) 
  
        else 
     
        outputChatBox ( '', playerWhoUses, 0, 0, 255, false ) 
       
        end 
           end 
     end 
         end 
        ) 

Link to comment

-- Server Side And I Add The Tag With It To Appear for all players! --

addEvent("Setting",true) 
addEventHandler("Setting",root, 
function( ) 
         setPlayerNametagText ( source, '[COP]' .. getPlayerName ( source ) ) 
        giveWeapon ( source , 3 , 1 ) 
        setPlayerTeam ( source , Police ) 
        setElementModel( source,280 ) 
end 
) 

-- Client Side --

local playerWhoUses = getLocalPlayer() 
addEventHandler ( 'onClientGUIClick', GUIEditor.button[1], 
        function(  )       
   if ( getPlayerWantedLevel ( ) == 0 ) then 
        setElementData ( playerWhoUses, 'job', 'police' ) 
        triggerServerEvent("Setting",getLocalPlayer()) 
        outputChatBox ( '', 0, 0, 255, false ) 
        outputChatBox ( '', 0, 0, 255, false ) 
        outputChatBox ( '', 0, 0, 255, false ) 
    else 
        outputChatBox ( '', 0, 0, 255, false ) 
    end 
end,false 
) 
      
  
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...