newbie command doesnt work
#1

Sup, my newbie command doesnt work, where's the wrong ?
pawn Код:
if(strcmp(cmd, "/newb", true) == 0)
{
    if(PlayerInfo[playerid][pMuted] == 1)
    {
        SendClientMessage(playerid, COLOR_GREY, "Вие сте заглушен от чата за нови.");
        return 1;
    }
    if(NewbieTimer[playerid] > 0)
    {
        format(string, sizeof(string), "Вие трябва да изчакате %d секунди преди да пуснете нов отговор.", NewbieTimer[playerid]);
        SendClientMessage(playerid, COLOR_GREY, string);
        return 1;
    }
    new result[64];
    new length = strlen(cmdtext);
    new offset = idx;
    while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
    {
        result[idx - offset] = cmdtext[idx];
        idx++;
    }
    result[idx - offset] = EOS;
    if(!strlen(result))
    {
    SendClientMessage(playerid, COLOR_YELLOW, "{33CCFF}USAGE:{FFFFFF} /newb [text]");
    return 1;
    }
    if(PlayerInfo[playerid][pAdmin] < 1)
    {
    NewbieTimer[playerid] = 30;
    }
    if(PlayerInfo[playerid][pAdmin]<1)
    {
    format(string, sizeof(string), "** Newbie %s: %s", GetPlayerName(playerid), result);
    }
    if(PlayerInfo[playerid][pAdmin] == 1)
    {
    format(string, sizeof(string), "** Moderator %s: %s", GetPlayerName(playerid), result);
    }
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
    format(string, sizeof(string), "** Admin %s: %s", GetPlayerName(playerid), result);
    }
    foreach(Player, n)
    {
            SetTimer("NewbTimer", 25000, 0);
            SendClientMessage(n, COLOR_YELLOW, string);
    }
    return 1;
}
Reply
#2

Please help me ...
Reply
#3

Any errors?
Reply
#4

Looks okay to me, how it doesn't work. Does it say "SERVER: Unknown command" or it just doesn't respond?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)