Scripts / Some conditions in weapon script does not work

Author
Message
MaximEpihin
User Deleted
Posted: 4th Jul 2015 12:50
Goal is to make the conditions of purchase of weapons by name. That is, if the weapon Colt 1911, the price of it buy 250.
I'm doing a zone and assign money.lua script in which global values are assigned and displayed the data you need:

Variables in global scripts written as:

In the weapons script.lua I changed the conditions in some places, because I need to do a background check on the name of the weapon and then compare price. But if the weapon is called a Shotgun, then demand the presence in the area and not worth the money, because that's the weapon you only need to look. For all other weapons need to verify the finding in the area of purchase and the name.

As you can see I changed the order of conditions, to make a purchase for each separately, but why not working? Debug(Prompt) showed that conditions generally are not performed.... What the problem is? Maybe he saw something wrong.
Create a game - it's like to start a new universe where there is only you and solitude with the environment

Attachments

Login to view attachments
!nullptr
Forum Support
9
Years of Service
User Offline
Joined: 27th Mar 2015
Location: Australia
Posted: 4th Jul 2015 14:02
In case no-one gets to this during my beauty sleep (about to occur in approx. 3 minutes) I'll have a look at this tomorrow.

Instinct says I can see the issue but sleep deprivation says "not now"...
AKA SisterMatic (Steam)
Development/ Gaming Rigs
Sys 1: i7-4770 (3.5)/16Gb/128 SSD/3Tb/970gtx/2 x 23, 1 x 27 LCD - Sys 2: i7/8Gb/670gtx/1.5Tb/1 x 23 LCD - Sys 3: Amd Quad/8Gb/645gtx/1Tb/30" LCD
PM
MaximEpihin
User Deleted
Posted: 4th Jul 2015 14:10
Quote: "I'll have a look at this tomorrow"

No problems, man I would like to see your help
Create a game - it's like to start a new universe where there is only you and solitude with the environment
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Jul 2015 15:36 Edited at: 4th Jul 2015 15:37
you are checking the gunid is above 0 before you try to buy the gun (this is not needed)


remove the parts i commented here
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11
MaximEpihin
User Deleted
Posted: 4th Jul 2015 17:56
Quote: "you are checking the gunid is above 0 before you try to buy the gun (this is not needed)
remove the parts i commented here"

I removed it, but it's not working now?
Create a game - it's like to start a new universe where there is only you and solitude with the environment
MaximEpihin
User Deleted
Posted: 4th Jul 2015 18:36
Closed, i have done this
Create a game - it's like to start a new universe where there is only you and solitude with the environment
smallg
Community Leader
19
Years of Service
User Offline
Joined: 8th Dec 2005
Location:
Posted: 4th Jul 2015 20:25
ah sorry it didnt copy the entire script (missing a few lines at the bottom) but i guess you already noticed
life\'s one big game

windows vista ultimate

i5 @3.3ghz, 4gb ram, geforce gtx460, directx 11

Login to post a reply

Server time is: 2024-12-22 01:18:11
Your offset time is: 2024-12-22 01:18:11