12.07.2011, 16:14
pawn Код:
if(strcmp(cmd, "/sethp", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethp [playerid/PartOfName] [health]");
new playa;
new health;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethp [playerid/PartOfName] [health]");
health = strvalEx(tmp);
if(PlayerInfo[playerid][pAdmin] >= 4)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
SetPlayerHealth(playa, health);
format(string, sizeof(string), " You have set %s's health to %d !",PlayerName(playa),health);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
}
else SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
}
return 1;
}
if(strcmp(cmd, "/setarmor", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setarmor [playerid/PartOfName] [armor]");
new playa;
new armor;
playa = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethp [playerid/PartOfName] [armor]");
armor = strvalEx(tmp);
if(PlayerInfo[playerid][pAdmin] >= 4)
{
if(IsPlayerConnected(playa))
{
if(playa != INVALID_PLAYER_ID)
{
GetPlayerName(playa, giveplayer, sizeof(giveplayer));
SetPlayerArmour(playa, armor);
format(string, sizeof(string), " You have set %s's armor to %d !", giveplayer,armor);
SendClientMessage(playerid, COLOR_GREY, string);
}
}
}
else SendClientMessage(playerid, COLOR_GRAD1, " You are not authorized to use that command !");
}
return 1;
}