13.12.2011, 00:57
params[0] isn't going to actually return their player id, it's in string format. You will need to use strval(params).
pawn Код:
CMD:slap(playerid, params[])
{
new id = strval(params);
new message[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_RED, "NOPE!");
new Float:x, Float:y, Float:z;
if(!params[0])) return SendClientMessage(playerid, 0xFFFFFFFFAA, "USAGE: /slap [playerid]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,COLOR_WHITE, "SERVER: Wrong ID / player has just quit.");
GetPlayerPos(id, x, y, z);
SetPlayerPos(id, x, y, z+5);
PlayerPlaySound(id, 1130, x, y, z+5);
format(message, sizeof(message),""COL_RED"[AdmSlap]: "COL_WHITE"%s was slapped by %s.",GetName(id), GetName(playerid));
SendClientMessageToAll(COLOR_WHITE, message);
return 1;
}