Whats wrong?
#1

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;
}
whats wrong with the cmd and timer? once i used my max uses (4) it then doesnt show the stop spamming message and i cant use it again (when i try using again it returns no message and does nothing)
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: 3 Guest(s)