Can't fix Warrning
#1

I have warrning
Quote:

(430) : warning 225: unreachable code

Line
Quote:

if(strcmp(cmdtext, "/Vipai", true)==0)

Can any help me ?
Reply
#2

Try This:
pawn Код:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
Also, Try using zcmd
Reply
#3

Show us your peace of code that you have above the warning line.
Reply
#4

Quote:
Originally Posted by Criss_Angel
Посмотреть сообщение
Try This:
pawn Код:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
Also, Try using zcmd
Don't work

Peace Of Code

Quote:

if(strcmp(cmdtext, "/Vipai", true)==0)
{
ShowPlayerDialog(playerid,5001,DIALOG_STYLE_MSGBOX ,"Serverio Vipai","Ernis_Vilkaviskis\nBeroza_Deva\nNera\nNera ","Ok","Ok");
return 1;
}

Reply
#5

What you have above that command? Show me that, not your command.
Reply
#6

I copied it from another gm
Reply
#7

Okay, maybe you don't understand me...
So what pawno is telling you, is that he can't reach that command what you made (/vipai) and there's gotta be something what's blocking pawno's way to compile your code successfully.

Just show us this:

pawn Код:
//what you have here?? show us...
if(strcmp(cmdtext, "/Vipai", true)==0)
{
ShowPlayerDialog(playerid,5001,DIALOG_STYLE_MSGBOX ,"Serverio Vipai","Ernis_Vilkaviskis\nBeroza_Deva\nNera\nNera ","Ok","Ok");
return 1;
}
Reply
#8

It compiles sucesfull but i have that error

Ehh my enlish is bad so i can't underdstand u good
Reply
#9

Show the command that is above "if(strcmp(cmdtext, "/Vipai", true)==0)" there will be a return there causing the error.

Please post a full block of code and not just one line.
Reply
#10

Quote:
Originally Posted by Lukasz56
Посмотреть сообщение
It compiles sucesfull but i have that error

Ehh my enlish is bad so i can't underdstand u good
Dang. :/
Yeah, I know it compiles but it's not successfully if you have that warning.


This is just simple example what you may did wrong.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;// you return it as false and then you start your command -> This line gives you warning because
    if (strcmp("/mycommand", cmdtext, true, 10) == 0) // compiler can't reach this command. (/mycommand)
    {
        // Do something here
        return 1;
    }
    return 0;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)