SA-MP Forums Archive
I, have error help please - 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: I, have error help please (/showthread.php?tid=324771)



I, have error help please - NeyMar96 - 10.03.2012

I, have this error:
PHP код:
error 001expected token"-string end-"but found "-identifier-" 
and this the code of error:
PHP код:
stock ggg(playerid,lvl)
{
#define COL_GREEN          "{6EF83C}"
#define COL_RED            "{F81414}"
if(PlayerInfo[playerid][AdminLvl] < lvlCOL_GREEN COL_RED) return 1;
return 
true;

help please..


Re: I, have error help please - ReneG - 10.03.2012

What is this code supposed to be doing?

pawn Код:
stock ggg(playerid,lvl)
{
#define COL_GREEN          "{6EF83C}"
#define COL_RED            "{F81414}"
if(PlayerInfo[playerid][AdminLvl] < lvl) return 1;
return true;
}



Re: I, have error help please - Shabi RoxX - 10.03.2012

Quote:
Originally Posted by NeyMar96
Посмотреть сообщение
I, have this error:
PHP код:
error 001expected token"-string end-"but found "-identifier-" 
and this the code of error:
PHP код:
stock ggg(playerid,lvl)
{
#define COL_GREEN          "{6EF83C}"
#define COL_RED            "{F81414}"
If(PlayerInfo[playerid][AdminLvl] < lvlCOL_GREEN COL_RED) return 1;
return 
true;

help please..
What is this? If col_red??
pawn Код:
If(PlayerInfo[playerid][AdminLvl] < lvl? COL_GREEN : COL_RED) return;
And u must define colors.on top of Ur srcitp


Re: I, have error help please - ReneG - 10.03.2012

You don't always need to define colors at the top. The colors will be defined once the stock is called. Get your facts straight dude.


Re: I, have error help please - Max_Coldheart - 10.03.2012

So, let me let it straight.
pawn Код:
if(PlayerInfo[playerid][AdminLvl] < lvl? COL_GREEN : COL_RED) return 1;
In English this would be:
if PlayerInfo, the playerid's AdminLvl is less than lvl return COL_GREEN else COL_RED and then after done return 1;

-I'm asking you, does this make any sense to you either?


Re: I, have error help please - Smally - 10.03.2012

No because how is it getting the lvl how does he know what it should be less than


Re: I, have error help please - Max_Coldheart - 10.03.2012

Quote:
Originally Posted by Lido
Посмотреть сообщение
No because how is it getting the lvl how does he know what it should be less than
first his returning colors and then if he cant return color his returning other color and then his returning 1.
Did this make any sense?


Re: I, have error help please - Vince - 10.03.2012

Should probably be something like this:
pawn Код:
return (PlayerInfo[playerid][AdminLvl] < lvl) ? COL_GREEN : COL_RED;



Re: I, have error help please - Smally - 10.03.2012

No, I think he has posted code that's impossible to fix here for us to become god and fix


Re: I, have error help please - Kaczmi - 10.03.2012

Код:
stock ggg(playerid,lvl) 
{ 
#define COL_GREEN         0x6EF83C 
#define COL_RED            0xF81414 
if((PlayerInfo[playerid][AdminLvl] < lvl) ? SetPlayerColor(playerid,COL_GREEN) : SetPlayerColor(playerid,COL_RED)) return 1; 
return 0; 
}
this?