Jump to content

why


Wei

Recommended Posts

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

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

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