Jump to content
Sign in to follow this  
Horner

Vehicle Buying/ Spawing script

Recommended Posts

Ok heres my script

if (money < 4000) then
{
   player1 groupChat format ["You can not afford this item. You only have $%1", (money)];
} else {
   money = money - 4000;
   car_sedan = "Sedan" createVehicle (getMarkerPos "vehic_spawn");
   player1 groupChat format ["You bought a Skoda and have $%1 remaining", (money)];
};

anyone see an error this is almost the exact same way i buy guns but i want the vehicle to spawn on the marker vehic_spawn it takes my money and tells me i have bought it but it doesnt spawn.

Share this post


Link to post
Share on other sites

the variable money is global, are you sure thats right? Sounds like you want a local variable, like _money after you label _money as the unit's variable, sorry I dont have the perfect syntax, you know what I mean?

Share this post


Link to post
Share on other sites

first off hey whats up kolmain :) lol. But anyway ya inside my init.sqf i have money defined as a variable like this

money = 4000;

now my money system isnt perfect yet but i dont exactly know how to set money for specific units the variable is global yes. But I have the shop set up and its working I just need help making the vehicle spawn.

And feel free just to message me in steam too.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×