29.11.2010, 16:33
This should do the trick...
pawn Код:
CMD:slap(playerid, params[])
{
if(sscanf(params, "u", id)) return SendClientMessage(playerid, 0xFF0000AA, "Usage: /slap <playerid>");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_DARKRED, "[ERROR:] This ID is has not been found.");
else
{
new Float:X, Float:Y, Float:Z, Float:Health, str[128], name[MAX_PLAYER_NAME];
PlayerPlaySound(id, 1190, X, Y, Z);
SetPlayerHealth(id, Health-25);
GetPlayerPos(id, X, Y, Z);
SetPlayerPos(id, X, Y, Z+7);
GetPlayerName(id, pName, sizeof(name));
GetPlayerName(id, aName, sizeof(name));
format(str, sizeof(str), "%s was slapped by %s", pName, aName);
SendClientMessageToAll(COLOR_DARKRED, str);
}
return 1;
}