Search the Community
Showing results for tags 'iSuck'.
Found 1 result
-
Hello, I'm in need of help with a script that's basicly a car shop. The units i'm using ingame are: 1 AI named "carseller" and 1 marker called "carspawn". This is the script: carseller addAction ["Buy Hatchback",{call fn_carBuySystem}, ["C_Hatchback_01_F", 200, "Hatchback"],6,false,false]; carseller addAction ["Buy Hobo",{call fn_carBuySystem}, ["C_man_p_fugitive_F", 3000, "Hobo"],6,false,false]; carseller addAction ["Buy Boxer",{call fn_carBuySystem}, ["C_Van_01_transport_F", 1500, "Boxer"],6,false,false]; carseller addAction ["Buy SUV",{call fn_carBuySystem}, [" C_SUV_01_F", 500, "SUV"],6,false,false]; carSeller addACtion ["Add 5000£ to wallet",{call fnc_addMoney}]; fn_carBuySystem = { private["_Money","_carSpawn"]; private ["_carID", "_carPrice", "_carName"," _caller"]; _carSpawn = carSpawn; _carID =(_this select 3) select 0; _carPrice = (_this select 3) select 1; _carName = (_this select 3) select 2; _carSpawn = carspawn; _caller = _this select 1; if (_Money >= _carPrice) then { _Money = _Money - _carPrice; sleep 3; _veh = _carID createVehicle (getPos _carSpawn); _veh setVehicleLock "LOCKED"; _veh setOwner (this select 3); _veh addAction ["Unlock Vehicle", {(_this select 0) setVehicleLock "UNLOCKED"}]; _veh addAction ["Lock Vehicle", {(_this select 0) setVehicleLock "LOCKED"}]; hint format ["You have bought a %1 and you have %2 dollars left.", _carName, _Money]; } else { hint "You do not have enough money for this car"; }; }; fnc_addMoney = { _Money = _Money + 5000; } Anyone got a clue what's wrong? :)