What's wrong ?
#1

Whenever i use /newb as a normal player it keep says "You have to wait for 30 seconds before using this channel again" even after the time sets to 0 it repeats the same message.
Here is the cmd
pawn Код:
CMD:newb(playerid, params[])
{
    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 ((nonewbie) && PlayerInfo[playerid][pAdmin] < 2)
    {
        SendClientMessageEx(playerid, COLOR_GRAD2, "The newbie chat channel has been disabled by an administrator!");
        return 1;
    }
    if(PlayerInfo[playerid][pNMute] == 1)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You are muted from the newbie chat channel.");
        return 1;
    }
    new string[128];
    if(NewbieTimer[playerid] > 0)
    {
        format(string, sizeof(string), "You must wait %d seconds before speaking again in this channel.", NewbieTimer[playerid]);
        SendClientMessageEx(playerid, COLOR_GREY, string);
        return 1;
    }
    if(gNewbie[playerid]==1)
    {
        SendClientMessageEx(playerid, COLOR_GREY, "You have the channel toggled, /tognewbie to re-enable!");
        return 1;
    }

    if(PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1)
    {
        NewbieTimer[playerid] = 30;
    }
    if(PlayerInfo[playerid][pHelper] >=1)
    {
        new toid, message[128];
        if(sscanf(params, "is", toid, message)) return Syntax(playerid, "newb", "[playerid] [message]");
        if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!");
        format(STRING, "Newb message from %s: %s", GetPlayerNameEx(playerid), message);
        SendClientMessageEx(toid, COLOR_NEWBIE, string);
        format(STRING, "%s %s [%d] > %s [%d]: %s", PlayerInfo[playerid][pHelper], GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
        SendHelperMessage(COLOR_NEWBIE,string);
    }
    else if(IsAdmin(playerid))
    {
        new toid, message[128];
        if(sscanf(params, "is", toid, message)) return Syntax(playerid, "newb", "[playerid] [message]");
        if(!IsPlayerConnected(toid)) return Error(playerid, "That player is not connected!");
        format(STRING, "Admin %s: %s", GetPlayerNameEx(playerid), message);
        SendClientMessageEx(toid, COLOR_NEWBIE, string);
        format(STRING, "Admin %s [%d] > %s [%d]: %s", GetPlayerNameEx(playerid), playerid, GetPlayerNameEx(toid), toid, message);
        SendHelperMessage(COLOR_NEWBIE,string);
    }
    else
    {
    new message[80];
    if(sscanf(params, "s", message)) return Syntax(playerid, "newb", "[question]");
    format(STRING, "Newb message from %s [%d]: %s", GetPlayerNameEx(playerid), playerid, message);
    SendHelperMessage(COLOR_NEWBIE,string);
    format(STRING, "Your question, has been sent to the online moderators.");
    SendClientMessageEx(playerid, COLOR_NEWBIE, string);
    }
    return 1;
}
++ REP
Reply
#2

what do you mean with "what's wrong" are you getting errors? if so show us the line, are you getting warnings if so then show us the line, you are not getting any warnings or errors but the command is not working? or what I don't understand.
Reply
#3

-fixed-
Reply
#4

-fixed-
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)