SA-MP Forums Archive
How to create an optional parameter in a function - 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: How to create an optional parameter in a function (/showthread.php?tid=531507)



How to create an optional parameter in a function - Magic_Time - 13.08.2014

FIXED.


Re: How to create an optional parameter in a function - nickdodd25 - 13.08.2014

pawn Код:
stock GivePlayerWantedLevel(playerid, type, targetid = INVALID_PLAYER_ID)
Then you can use it like so...
pawn Код:
GivePlayerWantedLevel(playerid, type, targetid);
//or
GivePlayerWantedLevel(playerid, type);