18.08.2012, 08:30
pawn Код:
CMD:slap(playerid, params[])
{
if(PlayerInfo[playerid][Adminlevel] < 1) return SendClientMessage(playerid,COLOR_ERROR,"[ERROR]: You are not authorized to use this command ");
new targetid;
if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_SYNTAX, "[SYNTAX]: /slap [PlayerID/PartOfName]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_ERROR, "[ERROR]: Player not connected!");
else
{
new Float:SLX, Float:SLY, Float:SLZ;
GetPlayerPos(targetid, SLX, SLY, SLZ);
SetPlayerPos(targetid, SLX, SLY, SLZ+5);
PlayerPlaySound(targetid, 1130, SLX, SLY, SLZ+5);
new string[128];
new pName[24], pTame[24];
GetPlayerName(playerid,pName,24);
GetPlayerName(targetid,pTame,24);
format(string,sizeof string,""#COL_YELLOW"[SERVER]"#COL_LRED" %s has been slapped by Administrator %s.",pTame,pName);
SendClientMessageToAll(COLOR_RED, string);
}
return 1;
}
The others should work.. Make sure you compile the script. **Laugh**