Captain Cody Posted November 25, 2015 Posted November 25, 2015 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 ()
DRW Posted November 25, 2015 Posted November 25, 2015 (edited) 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 November 25, 2015 by Guest Proud owner and developer of ZNEXT: Aftermath. Enter a post-apocalyptic San Andreas and fight over 30 types of enemies and bosses with varying difficulties and skills, improve and customize your character by leveling up, completing challenges and a solid lootbox system with no Pay-to-Win mechanics that will break your experience. Meet new characters, creatures and weapon metas, experience an innovative combo-based melee system, or join our solid PvP modes to show other survivors who’s boss. Español, Pусский, Türk, عربى, Polski, Português IP: mtasa://104.36.110.227:22003 - Discord: https://discord.gg/CxMxjvC5pB
Saml1er Posted November 25, 2015 Posted November 25, 2015 Two methods. 1. local team = createTeam (...) outputChatBox ( "(source) needs a taxi", team ) 2. for _, v in pairs ( getPlayersInTeam ( team ) ) do outputChatBox ( "(source) needs a taxi", v ) end
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