30.04.2015, 16:30
Hello guys i have problems with my admin team commands they are not working:
The problem is only the admin who is using the command will be afected not the other team members
also i tryed :
Its the same
PHP код:
CMD:freezeteam(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4 || IsPlayerAdmin(playerid))
{
new team[24];
if(sscanf(params, "s[24]",team)) return SendClientMessage(playerid, -1, "/freezeteam ballas | groves | vagos | aztecas");
foreach(new i: Player)
{
if(strcmp(team,"ballas",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_BALLAS)
TogglePlayerControllable(i,0);
return 1;
}
if(strcmp(team,"groves",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_GROVES)
TogglePlayerControllable(i,0);
return 1;
}
if(strcmp(team,"vagos",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_VAGOS)
TogglePlayerControllable(i,0);
return 1;
}
if(strcmp(team,"aztecas",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_AZTECAS)
TogglePlayerControllable(i,0);
return 1;
}
}
}
return 1;
}
CMD:giveteammoney(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4 || IsPlayerAdmin(playerid))
{
new money, team[42];
if(sscanf(params, "s[42]i", team, money)) return SendClientMessage(playerid, -1, "/giveteammoney [ ballas | groves | vagos | aztecas ] [Ammount]");
foreach(new i: Player)
{
if(strcmp(team,"ballas",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_BALLAS)
GivePlayerMoney(i, money);
return 1;
}
if(strcmp(team,"groves",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_GROVES)
GivePlayerMoney(i, money);
return 1;
}
if(strcmp(team,"vagos",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_VAGOS)
GivePlayerMoney(i, money);
return 1;
}
if(strcmp(team,"aztecas",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_AZTECAS)
GivePlayerMoney(i, money);
return 1;
}
}
}
return 1;
}
CMD:giveteamscore(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 4 || IsPlayerAdmin(playerid))
{
new score, team[42];
if(sscanf(params, "s[42]i", team, score)) return SendClientMessage(playerid, -1, "/Giveteamscore [ ballas | groves | vagos | aztecas ] [Scores]");
foreach(new i: Player)
{
new CurrentScore = GetPlayerScore(i);
if(strcmp(team,"ballas",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_BALLAS)
SetPlayerScore(i, CurrentScore+score);
return 1;
}
if(strcmp(team,"groves",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_GROVES)
SetPlayerScore(i, CurrentScore+score);
return 1;
}
if(strcmp(team,"vagos",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_VAGOS)
SetPlayerScore(i, CurrentScore+score);
return 1;
}
if(strcmp(team,"aztecas",true) == 0)
{
new string[128];
if(gTeam[i] == TEAM_AZTECAS)
SetPlayerScore(i, CurrentScore+score);
return 1;
}
}
}
return 1;
}
also i tryed :
PHP код:
GetPlayerTeam instead of if(gTeam[i] == TEAM_AZTECAS)