Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-09-22 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
September 21, 2012, 10:32:32 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Making an Item  (Read 1645 times)
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2032



View Profile WWW Email
« on: December 20, 2009, 12:45:27 PM »

Basically like any race, you can hook events or use War3 Forwards

1 You register the item, remember the itemid.

2 Create your events / loops

3 When events / loops are triggered, check if player owns the item, and do proper item effects

Common functions for an item: (see interface for details)

itemid= CreateShopItem(String:name[],String:desc[],String:cost[])

OnItemPurchase(client,item);

OnItemLost(client,item);

War3_GetOwnsItem(client,item);

War3_SetOwnsItem(client,item);

See Shopitem and other community made items for examples
« Last Edit: December 21, 2010, 05:28:21 PM by Ownz » Logged

DarkEnergy
Frenzzy
Full Member
***
Posts: 217


337905984 frenzzy@live.ru
View Profile WWW
« Reply #1 on: December 22, 2010, 04:21:59 AM »

How can I do some check before purchase item?

For example:
Code:
If (GetClientTeam(client) == CT_TEAM) {
    If (HasDefuser(client)) {
        // Allow item purchase
    } else {
        // Disallow item purchase
        War3_ChatMessage(client, "You already have a defuser.");
    }
} else {
    // Disallow item purchase
    War3_ChatMessage(client, "You must be a CT team to purchase this item.");
}
Logged

O_o
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2032



View Profile WWW Email
« Reply #2 on: December 22, 2010, 12:36:59 PM »

request this feature
Logged

DarkEnergy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!