Copied from ladmin
Код:
if(strcmp(cmd, "/slap", true) == 0) {
if(PlayerInfo[playerid][Level] >= 2) {
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, red, "USAGE: /slap [playerid] [reason]");
return 1; }
new player1;
player1 = strval(tmp);
if(!IsPlayerConnected(player1) || player1 == INVALID_PLAYER_ID || (PlayerInfo[player1][Level] == ServerInfo[MaxAdminLevel]) ) {
SendClientMessage(playerid,red,"ERROR: Player is not connected or is yourself");
return 1; }
tmp = strtok(cmdtext, idx);
GetPlayerName(player1, playername, sizeof(playername)); GetPlayerName(playerid, adminname, sizeof(adminname));
format(string,256,"You have been slapped by Administrator %s %s ",adminname,cmdtext[7]); SendClientMessage(player1,red,string);
format(string,256,"You have slapped %s %s ",playername,cmdtext[7]); SendClientMessage(playerid,blue,string);
new Float:Health, Float:x, Float:y, Float:z; GetPlayerHealth(player1,Health); SetPlayerHealth(player1,Health-25); GetPlayerPos(player1,x,y,z); SetPlayerPos(player1,x,y,z+5); PlayerPlaySound(playerid,1190,0.0,0.0,0.0); PlayerPlaySound(player1,1190,0.0,0.0,0.0);
} else {
SendClientMessage(playerid,red,"ERROR: You need to be level 2 to use this command"); }
return 1; }
You mean /giveweapon [playerid] [weaponid] [ammo ammount] for admins?
Or that player who holds the weapon want to give other player his weapon for the ammount of ammo he wants.