| 08-09-2003, 12:59 AM | #1 |
Here is my trigger: Event: Dialog - A dialog button is clicked for PistolScreen1 Condition: (Clicked dialog button) Equal to USP1 (Player 1 (Red) Current gold) Greater than or equal to 500 Actions: Hero - Create |c0000ff00USP and give it to Counter Terrorist 0009 <gen> Player - Add -500 to Player 1 (Red) Current gold Like in CS, im trying to make it so that player 1 can hold only 1 pistol. Can anyone help?emote_confused |
| 08-09-2003, 04:40 AM | #2 |
Guest | Ummm if you only want one weapon the use "Set" instead of ADD. Not only that but don't add Negitive numbers your just asking for trouble. |
| 08-09-2003, 06:01 AM | #3 |
Wrong coolaboy, SET sets their money, he wants to subtract and the best way is to add with a negative. Go to the add trigger, the explanation even says "for subtracting use a negative". |
| 08-09-2003, 08:26 AM | #4 |
Use this triggers: Code:
One Item acquire
Events
Unit - A unit owned by Player 1 (Red) Acquires an item
Conditions
(Item-type of (Item being manipulated)) Equal to Tome of Experience
(Triggering unit) Equal to Hero
Actions
Set NbItems = (NbItems + 1)
If (NbItems Greater than 1) then do (Hero - Drop (Item being manipulated) from Hero) else do (Do nothing)Code:
One Item lose
Events
Unit - A unit owned by Player 1 (Red) Loses an item
Conditions
(Item-type of (Item being manipulated)) Equal to Tome of Experience
(Triggering unit) Equal to Hero
Actions
Set NbItems = (NbItems - 1)Replace Tome of Experience with your item and NbItems is an integer and hero a variable of type unit. |
| 08-09-2003, 08:38 AM | #5 | |
Quote:
Where do I find that? |
| 08-09-2003, 08:45 AM | #6 |
set variable. make that variable. |
| 08-09-2003, 08:55 AM | #7 |
Okay thx for the help. *Edit Im having trouble with the trigger, the trigger doesnt work for me.:bgrun: One Item Lose Events Unit - A unit owned by Player 1 (Red) Loses an item Conditions (Item-type of (Item being manipulated)) Equal to |c0000ff00Desert Eagle (Triggering unit) Equal to Hero Actions Set nbitems = 1 One Item Aquire Events Unit - A unit owned by Player 1 (Red) Acquires an item Conditions (Item-type of (Item being manipulated)) Equal to |c0000ff00Desert Eagle (Triggering unit) Equal to Hero Actions Set nbitems = 1 If (nbitems Greater than 1) then do (Hero - Drop (Item being manipulated) from Hero) else do (Do nothing) |
