joao1234 Posted March 7, 2013 Share Posted March 7, 2013 hey! im making a script but i want to prevent a player opens the gui when he its the marker and is in "Pizza Delivers" team code: addEventHandler ( "onClientMarkerHit", job, function (player) if (getElementType(player) == ("player")) and ((player) == localPlayer ) then if ( getPlayerTeam( localPlayer ) == "Pizza Delivers" ) then outputChatBox ( "You are already a Pizza Deliver!", 0, 255, 0 ) guiSetVisible(Window_Job,true) showCursor ( true ) end end end ) Link to comment
Castillo Posted March 7, 2013 Share Posted March 7, 2013 That's wrong, getPlayerTeam returns a team element, you must use getTeamName to get the name. addEventHandler ( "onClientMarkerHit", job, function ( player ) if ( getElementType ( player ) == "player" and player == localPlayer ) then local team = getPlayerTeam ( localPlayer ) if ( team and getTeamName ( team ) == "Pizza Delivers" ) then outputChatBox ( "You are already a Pizza Deliver!", 0, 255, 0 ) guiSetVisible ( Window_Job, true ) showCursor ( true ) end end end ) Link to comment
TAPL Posted March 7, 2013 Share Posted March 7, 2013 Since the event "onClientMarkerHit" work with players only, getElementType is not needed. 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