15.05.2012, 12:49
Use this...
pawn Код:
CMD:slap(playerid, params[])
{
if(AccountInfo[playerid][AdminLevel] >= 1)
{
new id;
if(!sscanf(params, "u", id))
{
new Name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME], string[128], Float:px, Float:py, Float:pz;
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
GetPlayerPos(id, px, py, pz);
SetPlayerPos(playerid, px, py, pz+10);
format(string, sizeof(string), "You have been slapped by administrator %s.", Name);
SendClientMessage(id, 0xFFFFFFFF, string);
format(string, sizeof(string), "You slapped %s.", PlayerName);
SendClientMessage(playerid, 0xFFFFFFFF, string);
return 1;
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /slap [PlayerId/PartOfName]");
}
else return SendClientMessage(playerid, 0xFFFFFFFF, "You are not alowed to use this command.");
}