Little help about 1 error
#1

PHP код:
CMD:togtips(playeridparams[])
{
        {
            
PlayerInfo[playerid][pTips] = 0;
            
SendClientMessage(playeridCOLOR_WHITE" You have toggled the tips {FF9900}off{FFFFFF}.");
        }
        else
        {
            
PlayerInfo[playerid][pTips] = 1;
            
SendClientMessage(playeridCOLOR_WHITE" You have toggled the tips {33AA33}on{FFFFFF}.");
        }
        return 
1;

PHP код:
error 029invalid expressionassumed zero 
error line:
PHP код:
else 
Reply
#2

Show us the line which has the error
Reply
#3

Else is the error line
Reply
#4

use a if statement to use else LOL

EG
pawn Код:
if(blah)
{
    // blah
}
else
{
    // ASD
}
Reply
#5

yes use else this way;

pawn Код:
if(PlayerInfo[playerid][pTips] == 0)
{
    //your stuff
}
else
{
    //other stuff of yours
}
Reply
#6

Thanks
Reply
#7

Make it look like this :
Код:
CMD:togtips(playerid, params[]) 
{ 
        if(PlayerInfo[playerid][pTips] == 0)
        {
            SendClientMessage(playerid, COLOR_WHITE, " You have toggled the tips {FF9900}off{FFFFFF}."); 
        } 
        else 
        { 
            SendClientMessage(playerid, COLOR_WHITE, " You have toggled the tips {33AA33}on{FFFFFF}."); 
        } 
        return 1; 
}
That should work.
Reply
#8

It will work but doesn't change a thing. u need to set the variable to 1 eg
PlayerInfo[playerid][pTips] = 1;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)