SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 23/08/2010, 07:03 PM   #1
Cameltoe
High-roller
 
Cameltoe's Avatar
 
Join Date: Apr 2010
Location: Norway
Posts: 1,741
Reputation: 24
Default Creating a function [ Need help ]

How would i make an function with optional parameters?

pawn Code:
forward Scm(playerid, color, Message[], OPTIONAL PARAMETER HERE);
public Scm(playerid, color, Message[], OPTIONAL PARAMETER HERE)
{
     return 1;
}
__________________

Quote:
Originally Posted by Cameltoe View Post
Share the progress so others who are looking for the same also find's their answer.
Quote:
Originally Posted by teomakedonija View Post
ahaha i don't want
Rep++;
Cameltoe is offline  
Old 23/08/2010, 07:07 PM   #2
iggy1
High-roller
 
iggy1's Avatar
 
Join Date: Mar 2009
Location: One past the end.
Posts: 2,421
Reputation: 271
Default Re: Creating a function [ Need help ]

Assign the param a value like
pawn Code:
Scm(playerid, color, Message[], OPTIONAL_PARAMETER = 1)

Then if you dont enter it its 1 anway.
iggy1 is offline  
Old 23/08/2010, 07:09 PM   #3
Cameltoe
High-roller
 
Cameltoe's Avatar
 
Join Date: Apr 2010
Location: Norway
Posts: 1,741
Reputation: 24
Default Re: Creating a function [ Need help ]

Quote:
Originally Posted by iggy1 View Post
Assign the param a value like
pawn Code:
Scm(playerid, color, Message[], OPTIONAL_PARAMETER = 1)

Then if you dont enter it its 1 anway.
Yeah ofc! thanks!
__________________

Quote:
Originally Posted by Cameltoe View Post
Share the progress so others who are looking for the same also find's their answer.
Quote:
Originally Posted by teomakedonija View Post
ahaha i don't want
Rep++;
Cameltoe is offline  
Old 23/08/2010, 07:10 PM   #4
iggy1
High-roller
 
iggy1's Avatar
 
Join Date: Mar 2009
Location: One past the end.
Posts: 2,421
Reputation: 271
Default Re: Creating a function [ Need help ]

Your welcome i was wondering this myself the other day and looked at some includes thats why the fast reply lol
iggy1 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
[Tutorial] Creating a new NPC kc Tutorials 1120 30/04/2019 03:00 PM
need help with NPC creating the_zande Help Archive 2 10/07/2010 12:44 AM


All times are GMT. The time now is 10:31 AM.


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