SA-MP Forums Archive
Question!!!!!! Confused :\ - 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)
+--- Thread: Question!!!!!! Confused :\ (/showthread.php?tid=496755)



Question!!!!!! Confused :\ - AnonScripter - 23.02.2014

hey guys, if this code:
pawn Код:
if(Some Code)
{
    Something;
    return 1;
}
does the same of this:
pawn Код:
if(Some Code) return Something;
==================================================
Does this mean that this:
pawn Код:
if(Some Code)
{
    Something;
}
does the same of this:
pawn Код:
if(Some Code) return !Something;
or this:
pawn Код:
if(Some Code)
{
    Something;
    return 0;
}
???????????????????


Re: Simple Question!!!!!! Confused :\ - newbienoob - 23.02.2014

If it is a "Simple Question", then why can't YOU answer it?


Re: Simple Question!!!!!! Confused :\ - AnonScripter - 23.02.2014

Quote:
Originally Posted by newbienoob
Посмотреть сообщение
If it is a "Simple Question", then why can't YOU answer it?
please if you don't want tot answer, then get out without post comment that don't make any sense.


Re: Question!!!!!! Confused :\ - Scenario - 23.02.2014

If you want to return 0 with the code, then do it like this:

pawn Код:
if(Some Code) return Something, 0;



Re: Question!!!!!! Confused :\ - SuperViper - 23.02.2014

pawn Код:
if(Some Code)
{
    Something;
    return 1;
}
is not the same as

pawn Код:
if(Some Code) return Something;
The first one will always return 1 but the second one will return whatever "Something" returns. If "Something" is this, then it will return 231:

pawn Код:
Something()
{
    return 231;
}
which would make it equal to

pawn Код:
if(Some Code)
{
    Something;
    return 231;
}