14.03.2011, 10:47
Quote:
i wanna add if player did /slap 0
without a reason it will slap and says reason not specified how to do it thanks |
pawn Код:
CMD:slap( playerid, params[ ] )
{
new ID, string[200], reason[66], Float:x, Float:y, Float:z, Float:Health;
new aName[MAX_PLAYER_NAME], pName[MAX_PLAYER_NAME];
if(sscanf(params, "uS(Not Specified)[65]", ID, reason)) return SendClientMessage(playerid, -1, "USAGE: /slap [PlayerID] [Reason]");
if(IsPlayerConnected(ID) && ID != INVALID_PLAYER_ID && ID != playerid)
{
GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
GetPlayerName(ID, pName, MAX_PLAYER_NAME);
GetPlayerHealth(ID,Health);
SetPlayerHealth(ID,Health-25);
GetPlayerPos(ID,x,y,z);
SetPlayerPos(ID,x,y,z+5);
PlayerPlaySound(ID,1190,0.0,0.0,0.0);
format(string,sizeof(string),"AdmCmd: %s was Slapped by Admin %s Reason: %s",pName, aName, reason);
SendClientMessageToAll(-1,string);
}
else return SendClientMessage(playerid, -1, "ERROR: Player is not connected or is yourself.");
return 1;
}