11.08.2012, 19:03
Here goes....
pawn Код:
new uses[MAX_PLAYERS];
CMD:explode(playerid, params[])
{
if(PlayerInfo[playerid][Padmin] < 2) return SendClientMessage(playerid,-1,#level not enought);
if(uses[playerid] > 3) return SendClientMessage(playerid,-1,#max usage is 4 times, you can't use it again);
if(GetPVarInt(playerid,#countdown) > gettime()) return SendClientMessage(playerid,-1,#you must wait 30 seconds before use it again);
new id, string[128],Float:X, Float:Y, Float:Z;
if(sscanf(params,"u",id)) return SendClientMessage(playerid, COLOR_GREEN, "USAGE: /explode <id>");
if(id == playerid) return SendClientMessage(playerid, COLOR_RED, "You cannot use this command on yourself.");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
GetPlayerPos(id, X, Y, Z);
CreateExplosion(X, Y, Z, 0, 5);
format(string, sizeof(string), "You have been blown up by %s", PlayerName(playerid));
SendClientMessage(playerid, COLOR_GREEN, string);
format(string, sizeof(string), "You have blown up %s", PlayerName(id));
SendClientMessage(id, COLOR_RED, string);
SetPVarInt(playerid,#countdown,gettime() + 30);
uses[playerid]++;
return 1;
}