04.08.2011, 14:10
pawn Код:
dcmd_slap(playerid,params[])
{
if(IsPlayerCommandLevel(playerid,"slap"))
{
if(!strlen(params)) return SendClientMessage(playerid,red,"Usage: /slap [playerid] [reason]");
new tmp[256],Index; tmp = strtok(params,Index);
new id; if(!IsNumeric(tmp)) id = ReturnPlayerID(tmp); else id = strval(tmp);
if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID && id != playerid)
{
new string[256],name[24],ActionName[24]; GetPlayerName(playerid,name,24); GetPlayerName(id,ActionName,24);
if(!strlen(params[strlen(tmp)+1]))
format(string,256,"[INFO]: %s [ID:%d] has been slapped by %s [ID:%d] for: No Reason Given",ActionName,id,name,playerid);
else
format(string,256,"[INFO]: %s [ID:%d] has been slapped by %s [ID:%d] for: %s)",ActionName,id,name,playerid,params[strlen(tmp)+1]);
SendClientMessageToAll(yellow,string);
new Float:x, Float:y, Float:z;GetPlayerPos(id, x,y,z); //Line 374
return SetPlayerPos(id, x,y,z+5);
}
else
return SendClientMessage(playerid,red,"ERROR: You cannot slap yourself or a disconnected player.");
}
else
return SendLevelErrorMessage(playerid,"slap");
}