Can't fix Warrning - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Can't fix Warrning (
/showthread.php?tid=227463)
Can't fix Warrning -
Lukasz56 - 17.02.2011
I have warrning
Quote:
(430) : warning 225: unreachable code
|
Line
Quote:
if(strcmp(cmdtext, "/Vipai", true)==0)
|
Can any help me ?
Re: Can't fix Warrning -
Criss_Angel - 17.02.2011
Try This:
pawn Код:
if (strcmp("/mycommand", cmdtext, true, 10) == 0)
Also, Try using zcmd
Re: Can't fix Warrning -
xRyder - 17.02.2011
Show us your peace of code that you have above the warning line.
Re: Can't fix Warrning -
Lukasz56 - 17.02.2011
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;
}
|
Re: Can't fix Warrning -
xRyder - 17.02.2011
What you have above that command? Show me that, not your command.
Re: Can't fix Warrning -
Lukasz56 - 17.02.2011
I copied it from another gm
Re: Can't fix Warrning -
xRyder - 17.02.2011
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;
}
Re: Can't fix Warrning -
Lukasz56 - 17.02.2011
It compiles sucesfull but i have that error
Ehh my enlish is bad so i can't underdstand u good
Re: Can't fix Warrning -
iggy1 - 17.02.2011
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.
Re: Can't fix Warrning -
xRyder - 17.02.2011
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;
}