Jump to content

Chat message only visible to people on a certain team


Captain Cody

Recommended Posts

taxidriver = getPlayersInTeam ( TaxiDriverTeam ) 
outputChatBox ( "(source) needs a taxi", taxidriver ) 
  
Debug - Expected element, got table 

How would I do this, cannot find any thing on wiki to do this.

And how would I define the person who did the command, using source gives me debug expected element got nil.

addCommandHandler ("taxi", taxiMessage)  
function taxiMessage () 
  

Link to comment
  
addCommandHandler ("taxi",function(player) 
-- player is the source of the server-executed command 
outputChatBox ( "This is only seen by you", player ) 
  
  
taxidriver = getPlayersInTeam ( TaxiDriverTeam ) 
for i,drivers in ipairs (taxidriver) do --This gets all the players in the team 
outputChatBox ( "(source) needs a taxi", drivers) --This outputs to every player in the team 
end 
  
  
end) 

I've fused both funcions in the same command.

EDIT: Edited the code, it was wrong

Edited by Guest
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...