Need Help With this Unreachable Code
#7

the reason it didnt work is you close the beginning of the if statement then tried to make it work from the middle of the if statement.

you cant start an if statement from an else

ie

if(){
if(){
if(){
}
}
}

each if has to be opened and closed

if i was to take away one of those ifs without sorting the other end of it, it will throw up an exception

example

if(){
//if(){
if(){
}
}
}

there are still 3 closes but only 2 opens

which means that the script is trying to close something that isnt there (or maybe the entire function) before its sposed to.

note that all public functions work the same way:

public OnPlayerStateChange(playerid, newstate, oldstate)
{
}

so you might be removing something in the middle but accidentally ending the public function too early and leaving script that isnt related to anything outside a function.

this is what throws up exceptions. as you are new to coding having an explanation is handy.
Reply


Messages In This Thread
Need Help With this Unreachable Code - by ihatetn931 - 05.01.2010, 06:58
Re: Need Help With this Unreachable Code - by Striker_Moe - 05.01.2010, 07:04
Re: Need Help With this Unreachable Code - by ihatetn931 - 05.01.2010, 07:08
Re: Need Help With this Unreachable Code - by Calon - 05.01.2010, 07:38
Re: Need Help With this Unreachable Code - by ihatetn931 - 05.01.2010, 17:21
Re: Need Help With this Unreachable Code - by Calon - 06.01.2010, 07:17
Re: Need Help With this Unreachable Code - by adsy - 06.01.2010, 13:15

Forum Jump:


Users browsing this thread: 4 Guest(s)