Please help +Rep
#1

I am trying a lot to make a team vehicles and when player did something all the team eran money from that...

Someone can help me with this please?
Reply
#2

You need to loop through all the players and get if the player team equal to any other player team.

Example:
PHP код:
CMD:action(playerid//I did it under command. However you can use it anywhere like OnPlayerEnterCheckpoint in your case.
{
    for(new 
0GetPlayerPoolSize(); <= ji++) //Loop through all the players
    
{
        if(
GetPlayerTeam(playerid) == GetPlayerTeam(i)) //You need to SetPlayerTeam first. Or use your team variable
        
{
            
SendClientMessage(i, -1"You got score and money!"); //Notice that we used the i not playerid because we want to send it to the team not only to the player
            
GivePlayerMoney(i1000); //Giving $1000 to the team (including the player!)
            
SetPlayerScore(iGetPlayerScore(i)+2); //Giving 2 score (same as above)
        
}
    }
    return 
1;

Reply
#3

Quote:
Originally Posted by FailerZ
Посмотреть сообщение
You need to loop through all the players and get if the player team equal to any other player team.

Example:
PHP код:
CMD:action(playerid//I did it under command. However you can use it anywhere like OnPlayerEnterCheckpoint in your case.
{
    for(new 
0GetPlayerPoolSize(); <= ji++) //Loop through all the players
    
{
        if(
GetPlayerTeam(playerid) == GetPlayerTeam(i)) //You need to SetPlayerTeam first. Or use your team variable
        
{
            
SendClientMessage(i, -1"You got score and money!"); //Notice that we used the i not playerid because we want to send it to the team not only to the player
            
GivePlayerMoney(i1000); //Giving $1000 to the team (including the player!)
            
SetPlayerScore(iGetPlayerScore(i)+2); //Giving 2 score (same as above)
        
}
    }
    return 
1;

Thank u very much!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)