Errors with newbie channel
#1

Hi
i just wanted to do /newb channel but i got errors
pawn Код:
if(strcmp(cmdtext, "/n", true)==0)
{
    SendClientMessage(playerid, COLOR_GREY, "The (/n)ewbie chat has been renamed to (/newb)ie!");
    return 1;
}

if(strcmp(cmdtext, "/newb", true)==0)
{
    if(gPlayerLogged{playerid} == 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "You're not logged in.");
        return 1;
    }
    if(PlayerInfo[playerid][pTut] == 0)
    {
        SendClientMessage(playerid, COLOR_GREY, "You can't do that at this time.");
        return 1;
    }
    if ((nonewbie) && PlayerInfo[playerid][pAdmin] < 2)
    {
        SendClientMessage(playerid, COLOR_GRAD2, "The newbie chat channel has been disabled by an administrator!");
        return 1;
    }
    if(PlayerInfo[playerid][pNMute] == 1)
    {
        SendClientMessage(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]);
        SendClientMessage(playerid, COLOR_GREY, string);
        return 1;
    }
    if(gNewbie[playerid]==1)
    {
        SendClientMessage(playerid, COLOR_GREY, "You have the channel toggled, /tognewbie to re-enable!");
        return 1;
    }

    if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/newb)ie [text]");

    if(PlayerInfo[playerid][pHelper]<1&&PlayerInfo[playerid][pAdmin] < 2)
    {
        NewbieTimer[playerid] = 50;
    }
    else if(PlayerInfo[playerid][pHelper]==1&&PlayerInfo[playerid][pAdmin] < 2)
    {
        NewbieTimer[playerid] = 30;
    }
    else if(PlayerInfo[playerid][pAdmin] == 1)
    {
        NewbieTimer[playerid] = 30;
    }
    else if(PlayerInfo[playerid][pHelper]>=2&&PlayerInfo[playerid][pAdmin] < 2)
    {
        NewbieTimer[playerid] = 10;
    }
    if(PlayerInfo[playerid][pHelper]<1&&PlayerInfo[playerid][pAdmin]<1)
    {
        format(string, sizeof(string), "** Newbie %s: %s", GetPlayerNameEx(playerid), params);
    }
    if(PlayerInfo[playerid][pHelper] == 1&& PlayerInfo[playerid][pAdmin]<2)
    {
        format(string, sizeof(string), "** Helper %s: %s", GetPlayerNameEx(playerid), params);
        AddCAReportToken(playerid); // Advisor Tokens
    }
    if(PlayerInfo[playerid][pAdmin] == 1)
    {
        format(string, sizeof(string), "** Moderator %s: %s", GetPlayerNameEx(playerid), params);
    }
    if(PlayerInfo[playerid][pHelper] == 2&&PlayerInfo[playerid][pAdmin]<2)
    {
        format(string, sizeof(string), "** Community Advisor %s: %s", GetPlayerNameEx(playerid), params);
    }
    if(PlayerInfo[playerid][pHelper] == 3&&PlayerInfo[playerid][pAdmin]<2)
    {
        format(string, sizeof(string), "** Senior Advisor %s: %s", GetPlayerNameEx(playerid), params);
    }
    if(PlayerInfo[playerid][pHelper] >= 4&&PlayerInfo[playerid][pAdmin]<2)
    {
        format(string, sizeof(string), "** Chief Advisor %s: %s", GetPlayerNameEx(playerid), params);
    }
    if(PlayerInfo[playerid][pAdmin] >= 2)
    {
        format(string, sizeof(string), "** Admin %s: %s", GetPlayerNameEx(playerid), params);
    }
    foreach(Player, n)
    {
        if (gNewbie[n]==0)
        {
            SendClientMessage(n, COLOR_NEWBIE, string);
        }
    }
    return 1;
errors:
C:\Program Files\San Andreas\сшбш\gamemodes\M-RP.pwn(13605) : error 017: undefined symbol "nonewbie"
C:\Program Files\San Andreas\сшбш\gamemodes\M-RP.pwn(13610) : error 017: undefined symbol "pNMute"
C:\Program Files\San Andreas\сшбш\gamemodes\M-RP.pwn(13615) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Program Files\San Andreas\сшбш\gamemodes\M-RP.pwn(13616) : error 017: undefined symbol "NewbieTimer"
C:\Program Files\San Andreas\сшбш\gamemodes\M-RP.pwn(13616) : warning 215: expression has no effect
C:\Program Files\San Andreas\сшбш\gamemodes\M-RP.pwn(13616) : error 001: expected token: ";", but found "]"
C:\Program Files\San Andreas\сшбш\gamemodes\M-RP.pwn(13616) : error 029: invalid expression, assumed zero
C:\Program Files\San Andreas\сшбш\gamemodes\M-RP.pwn(13616) : fatal error 107: too many error messages on one line
It's a GF Gamemod
Reply
#2

Its because you used Copy + Paste
Reply
#3

How about you add the lines? we can't see line 13616 example. Thanks.

Also, as for nonewbie's part, try using
if (nonewbie)

Error : blalb n(13616) : error 001: expected token: ";", but found "]" Make sure your sentence ends with ;

13616) : error 029: invalid expression, assumed zero you missed a bracket somewhere

+rep if i helped

EDIT:

Try adding #define PNmute and the others at the top of your script
Reply
#4

Quote:
Originally Posted by G4M3Ov3r
Посмотреть сообщение
Its because you Copy + Paste
You right

@Chris_Morrison -
pawn Код:
new nonewbie = 0;
for the NewbieTimer: forward - public - settimer, for pNMute put it in your enum.
Reply
#5

NVM i want create new one how to do it?
Reply
#6

Quote:
Originally Posted by Chris_Morrison
Посмотреть сообщение
NVM i want create new one how to do it?
https://sampwiki.blast.hk/wiki/Scripting_Basics

This will help you.
Reply
#7

Look from the one you already copied, and try to rewrite it, using your variables of course.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)