SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 27/02/2010, 02:25 PM   #1
Gozerr
Little Clucker
 
Join Date: Jul 2008
Posts: 33
Reputation: 0
Default Optional parameters?

Im trying to create a function which looks like:

Function(playerid, optional:amount);

And when amount isn't specified, it will be 0.

I see this in some default functions (Blah(playerid, thing=1)

Thanks
Gozerr is offline  
Old 27/02/2010, 03:21 PM   #2
woot
Gangsta
 
Join Date: Jun 2007
Posts: 927
Reputation: 166
Default Re: Optional parameters?

pawn Code:
stock Function(playerid, amount = 0)
{
do();
}
__________________
woop
woot is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED \o/]sscanf and multiple optional parameters dcmd_crash Help Archive 29 26/04/2010 01:36 AM
Sm like an optional Parameter Rauminator Help Archive 2 06/02/2010 06:40 PM
Optional Parameters Dreftas Help Archive 1 11/10/2009 12:34 PM
using sscanf for optional integer inputs at the end of a command ( possible?) iLinx Help Archive 1 31/07/2009 09:00 PM


All times are GMT. The time now is 06:31 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.