(2019-04-16, 11:23 AM)Y_Less Wrote:(2019-04-14, 11:04 PM)DTV Wrote: I remember seeing a thread like this on SA-MP forums so it'd be nice to share with each other little tricks to making our lives easier with pawn, I'll start:
Actually don't know what this is formally called, but you can use it to skip parts of code when needed (good in a situation where the ending part of code is always the same but you don't need to copy/paste that code in every if/switch statement)
Code:-snip-
I'm not quite sure why this is trying to do. ?It would be exactly the same without the majority of this code:
Code:-snip-
The "return" ends the function early, so only code that passes your first check prints "Skipped".
I couldn't come up with a better example off the top of my head?without pulling out code that I can't show to everyone here.? The code I made wouldn't (hopefully) be a real life example of how you'd use but it was just to show "this is how you create it, this is how you use it, etc." rather than "this is a example of how you'd use it practically".
Stoned Ape