Errors with newbie channel -
Chris_Morrison - 25.08.2011
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
Re: Errors with newbie channel -
=WoR=G4M3Ov3r - 25.08.2011
Its because you used Copy + Paste
Re: Errors with newbie channel -
uprp - 25.08.2011
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
Re: Errors with newbie channel -
Jafet_Macario - 25.08.2011
Quote:
Originally Posted by G4M3Ov3r
Its because you Copy + Paste
|
You right
@Chris_Morrison -
for the NewbieTimer: forward - public - settimer, for pNMute put it in your enum.
Re: Errors with newbie channel -
Chris_Morrison - 25.08.2011
NVM i want create new one how to do it?
Re: Errors with newbie channel -
=WoR=G4M3Ov3r - 25.08.2011
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.
Re: Errors with newbie channel -
[MWR]Blood - 25.08.2011
Look from the one you already copied, and try to rewrite it, using your variables of course.