Help reconfigure this code -
ConsoleX - 19.03.2011
Hi,
I have a code for /n chat, can't seem to compile it
Код:
if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/n", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
}
return SendClientMessage( playerid, WHITE, "You haven`t logged in yet." );
{
if(PlayerInfo[playerid][pTut] == 0)
}
return Kick( playerid );
{
if((nonewbie) && PlayerInfo[playerid][pAdmin] < 3)
}
return SendClientMessage( playerid, COLOR_GREY, "The Newbie channel has been disabled by an Admin !" );
{
if(PlayerInfo[playerid][pNewbieMuted] == 1)
}
return SendClientMessage(playerid, COLOR_GREY, "You are banned from speaking in that channel !" );
{
if( UseNewbieTimer[playerid] == true )
return SendClientMessage(playerid,COLOR_GREY,"You must wait 50 seconds before speaking in that channel !" );
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
}
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/n)ewbie [newbie chat]");
}
if(PlayerInfo[playerid][pLevel] > 1 && PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 0) format(string, sizeof(string), "** Player %s: %s", sendername, result);
else if(PlayerInfo[playerid][pAdmin] >= 2) format(string, sizeof(string), "** Admin %s: %s", sendername, result);
else if(PlayerInfo[playerid][pHelper] >= 2) format(string, sizeof(string), "** Head Helper %s: %s", sendername, result);
else if(PlayerInfo[playerid][pDonateRank] >= 1) format(string, sizeof(string), "** VIP ** %s: %s", sendername, result);
else if(PlayerInfo[playerid][pHelper] == 1) format(string, sizeof(string), "** Helper %s: %s", sendername, result);
else format(string, sizeof(string), "** Newbie %s: %s", sendername, result);
OOCNewbie( NEWBIE_COLOR, string );
{
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 1)
UseNewbieTimer[playerid] = true; SetTimerEx("UseNewbie",50*1000,0,"i",playerid); }
}
}
}
errors:
Код:
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(2627) : error 004: function "FixHour" is not implemented
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(3997) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(4011) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(4417) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(4432) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(4486) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(4579) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(4589) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(4707) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(5437) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(5450) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(5680) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(5695) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(7245) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(7569) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(7582) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(10284) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(11401) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(11453) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(11528) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(11567) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(11583) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(11602) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(11621) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12597) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12598) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12627) : error 017: undefined symbol "encode_tires"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12643) : error 017: undefined symbol "encode_tires"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12642) : warning 204: symbol is assigned a value that is never used: "carid"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12643) : warning 204: symbol is assigned a value that is never used: "tires"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12641) : warning 203: symbol is never used: "lights"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12641) : warning 203: symbol is never used: "doors"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12641) : warning 203: symbol is never used: "panels"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12659) : error 017: undefined symbol "encode_tires"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12658) : warning 204: symbol is assigned a value that is never used: "carid"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12659) : warning 204: symbol is assigned a value that is never used: "tires"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12657) : warning 203: symbol is never used: "lights"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12657) : warning 203: symbol is never used: "doors"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12657) : warning 203: symbol is never used: "panels"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12693) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(12700) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(13310) : error 017: undefined symbol "ProxDetector"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(13577) : warning 217: loose indentation
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(15088) : error 004: function "FixHour" is not implemented
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(16413) : error 004: function "FixHour" is not implemented
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(16485) : error 004: function "FixHour" is not implemented
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(17852) : error 017: undefined symbol "dcmd_oprison"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(17854) : error 017: undefined symbol "dcmd_unban"
C:\Users\Marta\Desktop\samp03csvr_win32\pawno\GLRP.pwn(17855) : error 017: undefined symbol "dcmd_banaccount"
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
26 Errors.
Re: Help reconfigure this code -
Stigg - 19.03.2011
Looks like bracket problems with loose indentation.
Re: Help reconfigure this code -
jamesbond007 - 19.03.2011
pawn Код:
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 1)
{ // ur missing braket
UseNewbieTimer[playerid] = true; SetTimerEx("UseNewbie",50*1000,0,"i",playerid); }
Re: Help reconfigure this code -
ConsoleX - 19.03.2011
Still get those errors
Код:
if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/n", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
}
return SendClientMessage( playerid, WHITE, "You haven`t logged in yet." );
{
if(PlayerInfo[playerid][pTut] == 0)
}
return Kick( playerid );
{
if((nonewbie) && PlayerInfo[playerid][pAdmin] < 3)
}
return SendClientMessage( playerid, COLOR_GREY, "The Newbie channel has been disabled by an Admin !" );
{
if(PlayerInfo[playerid][pNewbieMuted] == 1)
}
return SendClientMessage(playerid, COLOR_GREY, "You are banned from speaking in that channel !" );
{
if( UseNewbieTimer[playerid] == true )
return SendClientMessage(playerid,COLOR_GREY,"You must wait 50 seconds before speaking in that channel !" );
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
}
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/n)ewbie [newbie chat]");
}
if(PlayerInfo[playerid][pLevel] > 1 && PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 0) format(string, sizeof(string), "** Player %s: %s", sendername, result);
else if(PlayerInfo[playerid][pAdmin] >= 2) format(string, sizeof(string), "** Admin %s: %s", sendername, result);
else if(PlayerInfo[playerid][pHelper] >= 2) format(string, sizeof(string), "** Head Helper %s: %s", sendername, result);
else if(PlayerInfo[playerid][pDonateRank] >= 1) format(string, sizeof(string), "** VIP ** %s: %s", sendername, result);
else if(PlayerInfo[playerid][pHelper] == 1) format(string, sizeof(string), "** Helper %s: %s", sendername, result);
else format(string, sizeof(string), "** Newbie %s: %s", sendername, result);
OOCNewbie( NEWBIE_COLOR, string );
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 1)
{
UseNewbieTimer[playerid] = true; SetTimerEx("UseNewbie",50*1000,0,"i",playerid); }
}
}
}
if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/n", true) == 0)
{
{ the top bracket only seems to go down to }
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/n)ewbie [newbie chat]");
}
I still get the same 26 errors.
Tested using notepad ++
Re: Help reconfigure this code -
ConsoleX - 19.03.2011
Someone I'm taking a look cant find the problem, Plus people try to use the /n chat on my server some spam it just like it fixed please if anyone has suggestions.
Re: Help reconfigure this code -
Fj0rtizFredde - 19.03.2011
As I can see you are using a } insteed of a { at lines like: if(gPlayerLogged[playerid] == 0) it should be like this:
pawn Код:
if(gPlayerLogged[playerid] == 0)
{
return SendClientMessage( playerid, WHITE, "You haven`t logged in yet." );
}
Now just find the other ones to
Re: Help reconfigure this code -
ConsoleX - 20.03.2011
I fixed that still get errors this code is trash wont compile piece of shit. Pardon my choice of words.
Код:
if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/n", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
return SendClientMessage( playerid, WHITE, "You haven`t logged in yet." );
if(PlayerInfo[playerid][pTut] == 0)
return Kick( playerid );
if((nonewbie) && PlayerInfo[playerid][pAdmin] < 3)
return SendClientMessage( playerid, COLOR_GREY, "The Newbie channel has been disabled by an Admin !" );
if(PlayerInfo[playerid][pNewbieMuted] == 1)
return SendClientMessage(playerid, COLOR_GREY, "You are banned from speaking in that channel !" );
if( UseNewbieTimer[playerid] == true )
return SendClientMessage(playerid,COLOR_GREY,"You must wait 50 seconds before speaking in that channel !" );
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/n)ewbie [newbie chat]");
if(PlayerInfo[playerid][pLevel] > 1 && PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 0) format(string, sizeof(string), "** Player %s: %s", sendername, result);
else if(PlayerInfo[playerid][pAdmin] >= 2) format(string, sizeof(string), "** Admin %s: %s", sendername, result);
else if(PlayerInfo[playerid][pHelper] >= 2) format(string, sizeof(string), "** Head Helper %s: %s", sendername, result);
else if(PlayerInfo[playerid][pDonateRank] >= 1) format(string, sizeof(string), "** VIP ** %s: %s", sendername, result);
else if(PlayerInfo[playerid][pHelper] == 1) format(string, sizeof(string), "** Helper %s: %s", sendername, result);
else format(string, sizeof(string), "** Newbie %s: %s", sendername, result);
OOCNewbie( NEWBIE_COLOR, string );
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 1)
{
UseNewbieTimer[playerid] = true; SetTimerEx("UseNewbie",50*1000,0,"i",playerid); }
}
}
}
3 hours trying to fix this haha, take brackets off put them on nothing works.
Re: Help reconfigure this code -
antonio112 - 20.03.2011
You receive other errors? Or still those errors?
ps: loose indentation means your code is 'fucked up' ...
Well, it looks more like:
Brackets, if's, everything is threw all around in a random way ... you should organize it. Something like:
pawn Код:
bla bla
{
if(bla bla)
{
if(a a a )
{
bla bla
}
}
}
Something like that. What do you think? Which one looks more readeable?
Re: Help reconfigure this code -
ConsoleX - 20.03.2011
This looks organized and readable, Not a pro scripter so I can't tell, but looks good and still would give me errors.
Код:
if(strcmp(cmd, "/newbie", true) == 0 || strcmp(cmd, "/n", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
return SendClientMessage( playerid, WHITE, "You haven`t logged in yet." );
}
if(PlayerInfo[playerid][pTut] == 0)
{
return Kick( playerid );
}
if((nonewbie) && PlayerInfo[playerid][pAdmin] < 3)
{
return SendClientMessage( playerid, COLOR_GREY, "The Newbie channel has been disabled by an Admin !" );
}
if(PlayerInfo[playerid][pNewbieMuted] == 1)
{
return SendClientMessage(playerid, COLOR_GREY, "You are banned from speaking in that channel !" );
}
if( UseNewbieTimer[playerid] == true )
return SendClientMessage(playerid,COLOR_GREY,"You must wait 50 seconds before speaking in that channel !" );
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[96];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/n)ewbie [newbie chat]");
}
if(PlayerInfo[playerid][pLevel] > 1 && PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 0) format(string, sizeof(string), "** Player %s: %s", sendername, result);
else if(PlayerInfo[playerid][pAdmin] >= 2) format(string, sizeof(string), "** Admin %s: %s", sendername, result);
else if(PlayerInfo[playerid][pHelper] >= 2) format(string, sizeof(string), "** Head Helper %s: %s", sendername, result);
else if(PlayerInfo[playerid][pDonateRank] >= 1) format(string, sizeof(string), "** VIP ** %s: %s", sendername, result);
else if(PlayerInfo[playerid][pHelper] == 1) format(string, sizeof(string), "** Helper %s: %s", sendername, result);
else format(string, sizeof(string), "** Newbie %s: %s", sendername, result);
OOCNewbie( NEWBIE_COLOR, string );
if(PlayerInfo[playerid][pAdmin] <= 1 && PlayerInfo[playerid][pHelper] <= 1)
{
UseNewbieTimer[playerid] = true; SetTimerEx("UseNewbie",50*1000,0,"i",playerid); }
}
}
}
Re: Help reconfigure this code -
antonio112 - 20.03.2011
The code isn`t enough, at least not at this hour, since I don`t feel like read through the whole code and think myself what the errors could be. So, if you would give me the errors along with the lines, I would appreciate it.
ps: Yes, that look organized ... I can bet you`re not receiving anymore "loose indentation" errors.
![Cheesy](images/smilies/biggrin.png)
or ...
Let me give you one advice.
Let`s say you put a 'if' statement.Underneath the 'if', you open the bracket ( { ). Then, on the next line, go to the bracket column ( to be on the same 'column' ) and press
TAB. Don`t use
Space in PAWNO when you're trying to arrange the code. Use TAB.
Something like:
pawn Код:
if( bla bla)
{
(TAB)if( bla bla) // Where you see (TAB) you need to press TAB
{
(TAB) SendClientMessage( playerid, -1, "bla bla" ); // Where you see (TAB) you need to press TAB
}
return SendClientbla bla
}
Now, this not only applies for statements. For the returns aswell. After each open bracket, on the next line, press
TAB. Hope you understood something.