Jump to content

Needing a small help guys S:


joao1234

Recommended Posts

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

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

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