25.11.2014, 12:00
Why this 2 commands dont work?
Код:
if(strcmp(cmd, "/setkill", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setkill [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, "/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;
}

