Jump to content

[Help] setPlayerTeam


Hunter567T

Recommended Posts

Ok I am trying to make a marker that when you touch it. It sets your team and skin. I did it first with just the skin and it worked fine but when I added the team part it stopped working.

Client (no Server)

  
local fireLV = createMarker ( 1746.64, 2081.58, 9.82, 'cylinder', 2, 29, 225, 52, 243 ) 
  
function MarkerHit1 ( hitPlayer ) 
 if (getPlayerSkin(hitPlayer) == 278 ) then 
 if (getPlayerTeam(hitPlayer) == LVFP ) then 
    outputChatBox("You are Already In The Las Venturas Fire Department", hitPlayer) 
 else 
    setPlayerSkin(hitPlayer, 278) 
    setPlayerTeam(hitPlayer, LVFP) 
    outputChatBox("Enjoy Your New Job As A Fireman In Las Venturas!", hitPlayer) 
    
      end 
   end 
end 
addEventHandler( "onMarkerHit", fireLV, MarkerHit1 ) 
  

Link to comment

DEBUG?

CLICK ME * CLICK ME * CLICK ME <-- HOT STUFF !

In debug window you will easly see that setPlayerTeam is not existing, then you will check MTA wiki to see that setPlayerTeam is SERVER SIDE. Also in wiki you can find out that setPlayerSkin is deprecated and you should use setElementModel instead.

Also, you should have know that client-side things are visible only in one client - it means if you change skin of player client side - other players will see that player as old skin!

Read more wiki.

You will need:

triggerServerEvent

setElementModel

setPlayerTeam

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