pawn Код:
dcmd_slap(playerid,params[]) {
if(PlayerInfo[playerid][LoggedIn] == 1) {
if(PlayerInfo[playerid][Level] >= 2) {
new tmp[256], tmp2[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index);
if(!strlen(params)) return SendClientMessage(playerid, orange, "USAGE: /slap [playerid] [reason]");
new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
player1 = strval(tmp);
new Float:Health, Float:x, Float:y, Float:z; GetPlayerHealth(player1,Health);
GetPlayerPos(player1,x,y,z); SetPlayerPos(player1,x,y,z+2); PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(player1,1190,0.0,0.0,0.0);
if(strlen(tmp2)) {
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
format(string,sizeof(string),"Adminstrator %s has slapped %s (%d) for: %s",adminname,playername,playerid, params[2]); return SendClientMessageToAll(orange,string); }
} else {
new player1, playername[MAX_PLAYER_NAME], adminname[MAX_PLAYER_NAME], string[128];
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
format(string,sizeof(string),"Adminstrator %s has slapped %s (%d) for [No Reason Defined]",adminname, playername, playerid); return SendClientMessageToAll(orange,string); }
} else return SendClientMessage(playerid,orange,"ERROR: You are not a high enough level to use this command");
} else return SendClientMessage(playerid, orange, "ERROR: You must be logged in to use this command");
return 1;
}