I had a try with these functions (V1, not the new version I think)
But, I couldn't get them to work
Basicly, I wanted to use them for a money system on an RPG mission.
So at the start (Tried init.sqs, and then renaming it to start and running it via radio trigger to see if running it before screwed it up, for some strange reason..), I run the following code :
;General scripty stuff
GetProperty = preprocessFile "getproperty.sqf"
SetProperty = preprocessFile "setproperty.sqf"
; Set up starting stuff
[aP1,"BankMoney",200] call SetProperty
[aP2,"BankMoney","200"] call SetProperty
[ap1,"PocketMoney",10] call SetProperty
[ap2,"PocketMoney",10] call SetProperty
; Debug
player sidechat FORMAT ["Debug - ap1 Bank : %1 :: ap2 Bank : %2 ::: ap1 Pocket : %3 :: ap2 Pocket : %4",[ap1,"BankMoney"] call GetProperty,[ap2,"BankMoney"] call GetProperty,[ap1,"PocketMoney"] call GetProperty,[ap2,"Pocket"] call GetProperty]
player sidechat "blah"
But, it never got to that sidechats..
I'll try the new version when I get back from holdiay (leaving tomorrow). But if I could get this working, it'd make the misison so much easier to code.
Instead of having a buy script for each player, and addng them in grouped-to-player triggers (Horrible). I could have dialouges (Need someone who can use dialouges, or learn them by self.. noo
), which run a buy script,
And check _this select 0 (not sure if this works with dialouges, but just the general idea) has enough money
If so, remove the cost from the varible (from gerproperty), and shove it back via setProperty.
This means there could be a single buy script, with a ?(_action=="gun"):goto "buyGun" for each thing (Cars, guns, food etc), which takes the money, and does appropriate action (create gun/ammo in weaponHolder thing, for example)
But, this all hinges on getting these functions to work
Is there something I'm doing wrong in that code?
Thanks
- Ben