08.09.2012, 12:07
I need this command applies to the actions of all players, not just one.
Код:
if(strcmp(cmd, "/givekill", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givekill [Playerid/PartOfName] [kills]");
return 1;
}
new playa;
new kills1;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
kills1 = strval(tmp);
if (PlayerInfo[playerid][pAdmin] == 1337)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
PlayerInfo[playa][pKills] += kills1;
SetPlayerScore(playa, PlayerInfo[playa][pKills]);
}
}
}
}
return 1;
}
Код:
if(strcmp(cmd, "/givemoney", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [Playerid/PartOfName] [money]");
return 1;
}
new playa;
new money;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
money = strval(tmp);
if (PlayerInfo[playerid][pAdmin] >= 1337)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GivePlayerCash(playa, money);
}
}
}
}
return 1;
}

