A Problem with a command
#1

Hello ,i've a problem with this /am command
pawn Код:
CMD:am(playerid, params[])
{
    new string[256];
    if(gPlayerLogged{playerid} == 0)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You're not logged in.");
        return 1;
    }
    if(PlayerInfo[playerid][pTut] == 0)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You can't do that at this time.");
        return 1;
    }
    if(PlayerInfo[playerid][pAmute] == 1) {
        SendClientMessageEx(playerid, COLOR_RED, "You are muted from using /am!");
        return 1;
    }
    if(noam == 1 && PlayerInfo[playerid][pAdmin] < 1)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "  The Admin Message System has been disabled by an adminstrator, try again later.");
        return 1;
    }
    if(PlayerInfo[playerid][pHelper]< 1 && PlayerInfo[playerid][pAdmin] < 1)
    {
        NewbieTimer[playerid] = 15;
    }
    if(PlayerInfo[playerid][pHelper] >= 1 && PlayerInfo[playerid][pAdmin] < 1)
    {
        NewbieTimer[playerid] = 5;
    }
    if(IsAdmin(playerid))
    {
        NewbieTimer[playerid] = 0;
    }
    if(NewbieTimer[playerid] > 0)
    {
        format(string, sizeof(string), "You must wait %d seconds before using this channel again.", NewbieTimer[playerid]);
        SendClientMessageEx(playerid, COLOR_GREY, string);
        return 1;
    }
    if(IsAdmin(playerid))
    {
        new toid, message[128];
        if(sscanf(params, "is[128]", toid, message)) return Syntax(playerid, "[a]dmin[m]essage", "[playerid] [message]");
        if(strlen(message) > 128) return Error(playerid, "Your message cannot be longer than 128 characters.");
        if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!");
        //new string[128];
        format(STRING, "Admin message from %s: %s", GetPlayerNameEx(playerid), message);
        SendClientMessageEx(toid, COLOR_GREEN, string);
        format(STRING, "Admin %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
        SendAdminMessage(COLOR_GREEN,string);
        Log("logs/adminmessage.log", string);
        PlayerInfo[playerid][pAMSSent] ++;
    }
    else
    {
        new message[80];
        if(sscanf(params, "s[80]", message)) return Syntax(playerid, "[a]dmin[m]essage", "[message]");
        if(strlen(message) > 80) return Error(playerid, "Your message cannot be longer than 80 characters.");
        //if(strfind(message, "Falling", true) != -1) return Error(playerid, "Type (/falling) and a administrative person will be there to assist you right away!");
        //new string[128];
        format(STRING, "Admin message from %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message);
        SendAdminMessage(COLOR_GREEN,string);
        format(STRING, "Your message, %s, has been sent.", message);
        SendClientMessageEx(playerid, COLOR_GREEN, string);
        format(STRING, "Player %s [%d] > Admins: %s", GetPlayerNameEx(playerid), playerid, message);
        Log("logs/adminmessage.log", string);
    }
    return 1;
}
it keeps repeating the "You must wait %d seconds before using this channel again." message when i'm a regular player even if i didn't use the /am ,Can someone help me with it ?
++ REP
Reply


Messages In This Thread
A Problem with a command - by Drago987 - 31.05.2014, 01:37
Re: A Problem with a command - by Ciandlah - 31.05.2014, 04:15
Re: A Problem with a command - by Dubya - 31.05.2014, 04:17
Re: A Problem with a command - by Threshold - 31.05.2014, 10:02
Re: A Problem with a command - by Aerotactics - 31.05.2014, 11:19
Re: A Problem with a command - by Eth - 31.05.2014, 11:23
Re: A Problem with a command - by Drago987 - 31.05.2014, 12:22
Re: A Problem with a command - by Threshold - 31.05.2014, 14:05
Re: A Problem with a command - by Drago987 - 31.05.2014, 15:32
Re: A Problem with a command - by Drago987 - 31.05.2014, 19:09

Forum Jump:


Users browsing this thread: 1 Guest(s)