I, have error help please
#1

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..
Reply
#2

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;
}
Reply
#3

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
Reply
#4

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.
Reply
#5

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?
Reply
#6

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

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?
Reply
#8

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

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

Код:
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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)