SA-MP Forums

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

 
 
Thread Tools Display Modes
Old 06/02/2010, 05:38 PM   #1
Rauminator
Little Clucker
 
Join Date: Jan 2010
Posts: 2
Reputation: 0
Default Sm like an optional Parameter

Hey Guys
I want to realize a Reallife Mode but I stack at the Carsystem.
My idea: A Optional Parameter to AddStaticVehicle but I know its not realizable without changing the corefiles.

Anyone with an idea?
Rauminator is offline  
Old 06/02/2010, 06:37 PM   #2
DeathOnaStick
High-roller
 
DeathOnaStick's Avatar
 
Join Date: May 2009
Location: 127.0.0.1
Posts: 1,074
Reputation: 27
Default Re: Sm like an optional Parameter

What do you mean? I don't understand neither, what you want to effect with it, nor, what you want to do with it. Please explain a bit further.
__________________
If this helps you, please thank me by giving me reputation points
DeathOnaStick is offline  
Old 06/02/2010, 06:40 PM   #3
Correlli
Godfather
 
Correlli's Avatar
 
Join Date: May 2009
Location: Slovenia
Posts: 7,161
Reputation: 361
Default Re: Sm like an optional Parameter

You don't need to change the core files.

Example:
pawn Code:
stock AddVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:angle, color1, color2, my_param)
{
  new
      vehicleID = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, angle, color1, color2);
  myVariable[vehicleID] = my_param;
  return vehicleID;
}

I haven't tested this, i guess you'll need to that.

If this is what you want?
Correlli 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
Optional parameters? Gozerr Help Archive 1 27/02/2010 03:21 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 03:15 PM.


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