Whats wrong?
#4

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");
            if(GetPVarInt(playerid,"CMDABUSE")>GetTickCount()) return SendClientMessage(playerid,COLOR_RED,"Please Wait Before Using This Command Again");
            SetPVarInt(playerid,"CMDABUSE",GetTickCount()+3000); // every 3 secs
            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;
    }
    return 1;
}

Well, it's better than creating timers for every single command.
Reply


Messages In This Thread
Whats wrong? - by thefatshizms - 11.08.2012, 15:37
Re: Whats wrong? - by Djole1337 - 11.08.2012, 15:42
Re: Whats wrong? - by thefatshizms - 11.08.2012, 15:49
Re: Whats wrong? - by Djole1337 - 11.08.2012, 15:53
Re: Whats wrong? - by thefatshizms - 11.08.2012, 15:56
Re: Whats wrong? - by thefatshizms - 11.08.2012, 15:58
Re: Whats wrong? - by thefatshizms - 11.08.2012, 18:47
Re: Whats wrong? - by leonardo1434 - 11.08.2012, 19:03

Forum Jump:


Users browsing this thread: 1 Guest(s)