11.08.2012, 15:37
pawn Код:
CMD:explode(playerid, params[])
{
if(PlayerInfo[playerid][Padmin] >=2)
{
if(Mxc[playerid] <=MAX_CMD)
{
new id, string[128], string2[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));
format(string2, sizeof(string), "You have blown up %s", PlayerName(id));
SendClientMessage(playerid, COLOR_GREEN, string2);
SendClientMessage(id, COLOR_RED, string);
Mxc[playerid] += 1;
return 1;
}
}
else if(PlayerInfo[playerid][Padmin] < 2)
{
SendClientMessage(playerid, COLOR_RED, "You are not admin.");
return 1;
}
else if(Mxc[playerid] > MAX_CMD)
{
SendClientMessage(playerid, COLOR_RED, "Please stop spamming. You cannot use this command for another 3 seconds");
SetTimer("cmdcool", 3000, false);
return 1;
}
return 1;
}
forward cmdcool(playerid);
public cmdcool(playerid)
{
Mxc[playerid] =0;
return 1;
}