Jump to content
Sign in to follow this  
ryansoper

Possible to call other functions with variables involved?

Recommended Posts

Hi guys,

Is it possible to do something like:

_truck1 = "S1203_TK_CIV_EP1" createVehicle(getMarkerPos "tSpawn1");

but where there is S1203_TK_CIV_EP1 could I replace it with a variable that would contain the vehicle, so I could have a player variable with their vehicle in instead?

Share this post


Link to post
Share on other sites

What are you trying to do? Create a specific vehicle for a given player(s)? I'm not understanding, could you elaborate further?

Share this post


Link to post
Share on other sites

Thats exactly what I want to do, so the player could have a 'vehicle' variable, and when they have purchased a vehicle, it gets stored there and I can then create that vehicle at a later date.

Thanks.

Share this post


Link to post
Share on other sites

hmm. I'm not the best person to help you with this. Maybe you could do it in a function

guy1Veh = {      if (player == guy1) then {_veh = "S1203_TK_CIV_EP1" createVehicleLocal (getMarkerPos "tSpawn1")}     }

call guy1veh

Something along those lines. I'm not very good at these sort of things.

Share this post


Link to post
Share on other sites

The best way to handle this is to assign the vehicle to the player, save it to him.

player setVariable["MyVehicle","S1203_TK_CIV_EP1"];

then in your script:

_veh = player getVariable "MyVehicle";

_veh createVehicleLocal (getMarkerPos "tSpawn1");

Share this post


Link to post
Share on other sites
The best way to handle this is to assign the vehicle to the player, save it to him.

player setVariable["MyVehicle","S1203_TK_CIV_EP1"];

then in your script:

_veh = player getVariable "MyVehicle";

_veh createVehicleLocal (getMarkerPos "tSpawn1");

What would be the best way to use this for an MP Game? Just replace the CreateVehicleLocal with CreateVehicle?

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×