SA-MP Forums Archive
is there a way to put more things in a return? - 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: is there a way to put more things in a return? (/showthread.php?tid=340241)



is there a way to put more things in a return? - niels44 - 06.05.2012

hey guys,

is there a way to put more things in a return?

so for example:
// codes here
return ShowMenuForPlayer(startmenu, playerid) HasCar[playerid] = 1;

or:

return
{
ShowMenuForPlayer(startmenu, playerid);
HasCar[playerid] = 1;
}

i already tried both of these but is there another way to make this? cuz it would be really nice and would be lot faster in my ondialogresponse cuz else i have to add: HasCar[playerid] = 1; then i have to add that on 570 lines and that takes damn much time AND makes teh script twice that huge , so anyone knows a way to make the return that way?

greets niels


Re: is there a way to put more things in a return? - Jonny5 - 06.05.2012

only way i know is to use a comma
but its not really returning both

pawn Код:
return ShowMenuForPlayer(startmenu, playerid) ,HasCar[playerid] = 1;



Re: is there a way to put more things in a return? - Vince - 06.05.2012

You can put commas. But it is quite useless to do so if the return value is of no importance.


Re: is there a way to put more things in a return? - niels44 - 06.05.2012

well it IS important in this case XD, thnx for the help guys , didnt knew a , would make the difference XD anyways thnx


Re: is there a way to put more things in a return? - Disturn - 06.05.2012

No need to do this. You can merely wrap your statements within a code block and return the value to true to omit any following code.