Warning Help
#1

i have This Warning

Код:
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1045) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase

Header size:           5348 bytes
Code size:          2847536 bytes
Data size:           326148 bytes
Stack/heap size:      16384 bytes; estimated max. usage=6563 cells (26252 bytes)
Total requirements: 3195416 bytes

1 Warning.
And Its The Line Of Warning


Код:
if(strcmp(cmdtext, "/gangcommands", true) == 0)
	{
     new xd[768];
	 new message[] = "\t\t\t\t\t\t SampEver Party Server Gang Commands \n\n\n\n\n\n 1- To Create A New Gang Use : /gang create [name]\n\n 2- To Invite Someone To Your Gang Use : /gang invite [playerID].";
	 new message2[] = "\n\n 3- To Join Any Gang Use : /gang join.\n\n 4- To See Your Gang Stats Use : /ganginfo [number] {Note : no number given shows your gang's info } \n\n 5- To Check Your Gang Money Use : /gbank [money] , /gwithdraw [money] ,/gbalance ";
	 format(xd, sizeof(xd),"%s %s",message,message2);
	 ShowPlayerDialog(playerid, 1244, DIALOG_STYLE_MSGBOX, "SampEver Party Server Gangs Commands", xd,"Okay", "");
	return 1;
	}
return 0;
 }
Reply
#2

You should really indent your code.

The ' unreachable code ' warning means you have return 0 or too many returns.

I removed return 0;

pawn Код:
if(strcmp(cmdtext, "/gangcommands", true) == 0)
{
    new xd[768];
    new message[] = "\t\t\t\t\t\t SampEver Party Server Gang Commands \n\n\n\n\n\n 1- To Create A New Gang Use : /gang create [name]\n\n 2- To Invite Someone To Your Gang Use : /gang invite [playerID].";
    new message2[] = "\n\n 3- To Join Any Gang Use : /gang join.\n\n 4- To See Your Gang Stats Use : /ganginfo [number] {Note : no number given shows your gang's info } \n\n 5- To Check Your Gang Money Use : /gbank [money] , /gwithdraw [money] ,/gbalance ";
    format(xd, sizeof(xd),"%s %s",message,message2);
    ShowPlayerDialog(playerid, 1244, DIALOG_STYLE_MSGBOX, "SampEver Party Server Gangs Commands", xd,"Okay", "");
    return 1;
}
Reply
#3

Oh man jesus. Start with increasing your strings.
pawn Код:
if(strcmp(cmdtext, "/gangcommands", true) == 0)
{
    new xd[768];
    new message[] = "\t\t\t\t\t\t SampEver Party Server Gang Commands \n\n\n\n\n\n 1- To Create A New Gang Use : /gang create [name]\n\n 2- To Invite Someone To Your Gang Use : /gang invite [playerID].";
    new message2[] = "\n\n 3- To Join Any Gang Use : /gang join.\n\n 4- To See Your Gang Stats Use : /ganginfo [number] {Note : no number given shows your gang's info } \n\n 5- To Check Your Gang Money Use : /gbank [money] , /gwithdraw [money] ,/gbalance ";
    format(xd, sizeof(xd),"%s %s",message,message2);
    ShowPlayerDialog(playerid, 1244, DIALOG_STYLE_MSGBOX, "SampEver Party Server Gangs Commands", xd,"Okay", "");
    return 1;
}
// This guy: grand.Theft.Otto was first.
Reply
#4

After Removing Return 0



Код:
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(865) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(866) : error 004: function "SendPlayerFormattedText" is not implemented
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(883) : error 017: undefined symbol "isStringSame"
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1023) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1024) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1031) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1037) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1043) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1046) : warning 225: unreachable code
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1053) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1062) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1072) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1091) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1103) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1119) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1140) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1161) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1181) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1205) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1214) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1220) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1233) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1246) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1259) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1272) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1285) : error 079: inconsistent return types (array & non-array)
C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvdm.pwn(1290) : error 079: inconsistent return types (array & non-array)

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


26 Errors.
Reply
#5

pawn Код:
// other stuff above

    if(strcmp(cmdtext, "/gangcommands", true) == 0)
    {
        new xd[768];
        new message[] = "\t\t\t\t\t\t SampEver Party Server Gang Commands \n\n\n\n\n\n 1- To Create A New Gang Use : /gang create [name]\n\n 2- To Invite Someone To Your Gang Use : /gang invite [playerID].";
        new message2[] = "\n\n 3- To Join Any Gang Use : /gang join.\n\n 4- To See Your Gang Stats Use : /ganginfo [number] {Note : no number given shows your gang's info } \n\n 5- To Check Your Gang Money Use : /gbank [money] , /gwithdraw [money] ,/gbalance ";
        format(xd, sizeof(xd),"%s %s",message,message2);
        ShowPlayerDialog(playerid, 1244, DIALOG_STYLE_MSGBOX, "SampEver Party Server Gangs Commands", xd,"Okay", "");
    }
    return 1;
}
Reply
#6

It's not only removing the return; but did you also removed that bracket?
Reply
#7

not working same problem



Quote:

C:\Documents and Settings\Kapil\Desktop\Samp03\samp03\gamemodes\lvd m.pwn(1046) : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

Header size: 5348 bytes
Code size: 2847524 bytes
Data size: 326148 bytes
Stack/heap size: 16384 bytes; estimated max. usage=6563 cells (26252 bytes)
Total requirements: 3195404 bytes

1 Warning.

Reply
#8

Show your OnPlayerCommandText (if it isn't too big)
Reply
#9

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	new string[256];
	new playermoney;
	new sendername[MAX_PLAYER_NAME];
	new giveplayer[MAX_PLAYER_NAME];
	new cmd[256];
	new giveplayerid, moneys, idx, weaponid;

	cmd = strtok(cmdtext, idx);

  	dcmd(login,5,cmdtext); // because login has 5 characters
  	dcmd(register,8,cmdtext); // because register has 8 characters
Reply
#10

I mean your whole OnPlayerCommandText, so we can be sure that you are returning everything correct.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)