SA-MP Forums Archive
newbie command doesnt work - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: newbie command doesnt work (/showthread.php?tid=452203)



newbie command doesnt work - JayceonTaylor - 20.07.2013

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;
}



Re : newbie command doesnt work - JayceonTaylor - 20.07.2013

Please help me ...


Re: newbie command doesnt work - PrivatioBoni - 20.07.2013

Any errors?


Re: newbie command doesnt work - Tayab - 20.07.2013

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