Wei Posted June 29, 2012 Share Posted June 29, 2012 addEvent("phone:callService", true) addEventHandler("phone:callService", getRootElement(), function( cReason, tTeam ) for k, v in ipairs (getElementsByType("player")) do if getTeamName(getPlayerTeam(v)) == tTeam then outputChatBox(getPlayerName(source).." has requested "..tTeam.." reason : "..cReason.." !", v) takePlayerMoney( source, 10000 ) outputChatBox("Request succefuly sent", source) end end end ) Why this works only for team wich the player is in ? Link to comment
Castillo Posted June 29, 2012 Share Posted June 29, 2012 if getTeamName(getPlayerTeam(v)) == tTeam then Maybe because of that? Link to comment
Castillo Posted June 29, 2012 Share Posted June 29, 2012 Mind posting how you trigger: "phone:callService" ? addEvent ( "phone:callService", true ) addEventHandler ( "phone:callService", getRootElement(), function ( cReason, tTeam ) for index, player in ipairs ( getPlayersInTeam ( getTeamFromName ( tTeam ) ) do outputChatBox ( getPlayerName ( source ) .." has requested ".. tTeam .." reason : ".. cReason .." !", player ) end takePlayerMoney ( source, 10000 ) outputChatBox ( "Request succefuly sent", source ) end ) 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