God warning
#1

Yesterday i made this command if(strcmp(cmd, "/godon", true) == 0) {
SendPlayerFormattedText(playerid,"God:ON to turn off do /godoff",0);
SetPlayerHealth(playerid,1000.0);
return 1;

}

if( strcmp( cmdtext, "/adminskin", true) == 0 )
SetPlayerSkin(playerid, 294);
return 1;


if(strcmp(cmd, "/godoff", true) == 0) {
SendPlayerFormattedText(playerid,"God:OFF to turn off do /godon",0);
SetPlayerHealth(playerid,100.0);
return 1;

}


and made without any errors but today when i compiled it i got

C:\Documents and Settings\Adminisondre\Desktop\coding\gamemodes\lvd m.pwn(15 : warning 225: unreachable code
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


1 Warning.



EDIT: THE WARNING IS IN GODOFF COMMAND IF I REMOVE IT IT WILL JUST COME WARNING ON /KILL THEN /GODON
Reply
#2

curly-brackets are missing from the /adminskin commands IF statement. "return 1;" is the unreachable code.

EDIT: You should also decide if you are going to use cmd or cmdtext
Reply
#3

No what is unreachable is all code after the return
Reply
#4

Quote:
Originally Posted by Nubotron
No what is unreachable is all code after the return
ah, yes indeed
Reply
#5

How can i fix it?
Reply
#6

Quote:
Originally Posted by [KML
Dabug ]
How can i fix it?
Since the problem is missing curly braces (or curly brackets), you might want to try adding them..
Reply
#7

i will try
Reply
#8

Lol, signatured
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)