AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Stock\function] making a param opitional (https://forums.alliedmods.net/showthread.php?t=47684)

k007 11-24-2006 00:48

[Stock\function] making a param opitional
 
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

Emp` 11-24-2006 01:29

Re: [Stock\function] making a param opitional
 
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.

k007 11-24-2006 08:08

Re: [Stock\function] making a param opitional
 
it could be a stock though right?

VEN 11-24-2006 08:16

Re: [Stock\function] making a param opitional
 
Right.

k007 11-24-2006 08:51

Re: [Stock\function] making a param opitional
 
Ty


All times are GMT -4. The time now is 06:59.

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