Raised This Month: $ Target: $400
 0% 

[Stock\function] making a param opitional


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 11-24-2006 , 00:48   [Stock\function] making a param opitional
Reply With Quote #1

lets say i made a stock with 3 param for example
Code:
set_gaben_hunger(index, value, 3 param is opitional is 1 give him some apples)
so how do i make that param opitional ? opitional i mean i could go set_gaben_hunger(index, 1000000) and will not get any compile errors
k007 is offline
Send a message via MSN to k007
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 11-24-2006 , 01:29   Re: [Stock\function] making a param opitional
Reply With Quote #2

function(blah, blah2, blah3=1) //note that it can be set to a bool or float also

//also note that it cannot be a public function.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 11-24-2006 , 08:08   Re: [Stock\function] making a param opitional
Reply With Quote #3

it could be a stock though right?
k007 is offline
Send a message via MSN to k007
VEN
Veteran Member
Join Date: Jan 2005
Old 11-24-2006 , 08:16   Re: [Stock\function] making a param opitional
Reply With Quote #4

Right.
VEN is offline
k007
BANNED
Join Date: Mar 2006
Location: bacon?
Old 11-24-2006 , 08:51   Re: [Stock\function] making a param opitional
Reply With Quote #5

Ty
k007 is offline
Send a message via MSN to k007
Reply



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

Forum Jump


All times are GMT -4. The time now is 11:24.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode