Jump to content
Sign in to follow this  
Horner

Money System again.

Recommended Posts

Hey guys this one guy gave me his idea for a money system but I dont know what im doing wrong.

Ok in my init.sqf I put

money = 1000;

Okay now I put in a trigger.

hint format ["You have $%1", (money)];

But those two things arent the problems, I can see my money, and It is the right amount ($1000) but I'm having problems with my shops.

Ok I have a gun seller named "gun_seller1" and heres the script for him.

BuyMakarov = gun_seller1 addAction ["Buy Makarov ($300)", "buyguns.sqf"];

Okay now in my buyguns.sqf I have exactly this.

if (money < 300) then
{
player1 groupChat format ["You cannot afford this item. You only have $%1", (money)];
} else {

   	money = money - 300;
   	civ_1 addWeapon "Makarov";
   	civ_1 groupChat format ["You bought a "Makarov" and have $%1 remaining", (money)];
};

Does anyone see an error? If yes please let me know. :)

Share this post


Link to post
Share on other sites

civ_1 groupChat format ["You bought a "Makarov" and have $%1 remaining", (money)];

error is the "" around makarov inside ""

for usage inside use ""makarov"" or 'makarov'

Edited by Demonized

Share this post


Link to post
Share on other sites

in the error if statement your sending the chat to - player1

and your adding the weapon to - civ_1

Share this post


Link to post
Share on other sites

ok so ill switch to player1 for all then change to 'makarov' thanks guys

---------- Post added at 05:14 PM ---------- Previous post was at 05:07 PM ----------

Ok i switched all that and made them all player1 and changed the scripts but it is still doing the same thing. idk whats wrong?

Share this post


Link to post
Share on other sites
but it is still doing the same thing.

well. whats the thing???

edit: this will help you:

add -showscripterrors to your desktop shortcut.

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  

×