Shopmenu: wcs/WCSshop/es_WCSshop_db.txt
you'll find there a template for new shopitems:
Code:
// Format:
// "number" // unique ID *New: can be a unique name without spaces!
// {
// "name" "Name" // The name of the item, keep it short
// "description" "text" // Description of the item
// "category" "number" // number is 1-5, sorts the item in the category enhancements, powerup, attack, defense, specials
// "cost" "cost" // The cost of the item
// "level" "number" // Required level to buy/use this item, default is 0
// "dab" "0/1/2" // Player must to be dead (0), alive (1) or both (2) to buy
// "duration" "number" // only this round (0) or until death (1), doesn't work with player_buy
// "itemconfig" "type" // Valid types are: player_buy (default), player_death,
// // player_attacker, player_victim, player_spawn, player_say, player_bomb, player_defuse
// // the cmd is executed on this event
// "cmdbuy" "code" // The command is run on purchase
// "cmdactivate" "code" // The command is run when item is activated, not used with player_buy
// }
// in CS:S maximum HP is 511, maximum armor is 127, higher values will start at 0 again
// "number" // unique ID *New: can be a unique name without spaces!
// {
// "name" "Name" // The name of the item, keep it short
// "description" "text" // Description of the item
// "category" "number" // number is 1-5, sorts the item in the category enhancements, powerup, attack, defense, specials
// "cost" "cost" // The cost of the item
// "level" "number" // Required level to buy/use this item, default is 0
// "dab" "0/1/2" // Player must to be dead (0), alive (1) or both (2) to buy
// "duration" "number" // only this round (0) or until death (1), doesn't work with player_buy
// "itemconfig" "type" // Valid types are: player_buy (default), player_death,
// // player_attacker, player_victim, player_spawn, player_say, player_bomb, player_defuse
// // the cmd is executed on this event
// "cmdbuy" "code" // The command is run on purchase
// "cmdactivate" "code" // The command is run when item is activated, not used with player_buy
// }
// in CS:S maximum HP is 511, maximum armor is 127, higher values will start at 0 again
Notice: category is new in v0.70, and also multilanguage support !
Shopmenu: wcs/WCSshop/es_WCSshop_cat_db.txt
You can create up to NINE shop categories, with each max. NINE items
Code:
"WCSshop_cat"
{
"1"
{
"name" "wcs_lng_s_cenh"
"descr" "wcs_lng_s_cenhd"
}
"2"
{
"name" "new category name"
"descr" "don't know whats in it"
}
}
{
"1"
{
"name" "wcs_lng_s_cenh"
"descr" "wcs_lng_s_cenhd"
}
"2"
{
"name" "new category name"
"descr" "don't know whats in it"
}
}
I give you the example of "Periapt of Health" and show you how it works
Code:
"4"
{
"name" "wcs_lng_s_periapthp"
"description" "wcs_lng_s_periapthpd"
"category" "2"
"cost" "6500"
"level" "0"
"dab" "1"
"duration" "1"
"itemconfig" "player_spawn"
"cmdbuy" "es est_Health event_var(userid) + 50"
"cmdactivate" "es est_Health event_var(userid) + 50"
{
"name" "wcs_lng_s_periapthp"
"description" "wcs_lng_s_periapthpd"
"category" "2"
"cost" "6500"
"level" "0"
"dab" "1"
"duration" "1"
"itemconfig" "player_spawn"
"cmdbuy" "es est_Health event_var(userid) + 50"
"cmdactivate" "es est_Health event_var(userid) + 50"
name & description
You could still write here "Periapt of Health" or whatever, but with the new multilanguage support, you can just edit the "wcs/WCSlanguage/es_WCSlanguage_db.txt" and create a new entry "wcs_lng_s_periapthp" "Periapt of Health" and the same for the language of your choice.
category
Since v0.70, there are 5 categorys to get fast to the item you want to buy:
enhancements, powerup, attack, defense, specials
Give here the number of the category, each can keep up to 9 items, and you CAN create a new category, see es_WCSshop.txt for details. But if you're not experienced with ES, you should stick to this 5 categories.
The Periapt is an powerup item.
* Since 0.76+, you can create your own categories.
cost
How much money ? Counts same as credits in DOD:S
The Periapt costs $6500, its not cheap, but it should give you every round +50HP
level
Minimum level (current race level !), 0 unlocks for all players
dab
allow buy on Death=0, Alive=1, or Both=2
The Periapt can be bought only if the player is alive ! (1)
duration
You can define if the player can hold the item over the round. If you set this to 1, the player has this item until death. If this is 1, cmdactivate should not be empty !
The Periapt will be a "permanent" item, until the player dies, so value is 1
itemconfig
When should the code be executed ?
player_attacker, player_victim, player_spawn, player_say, player_bomb, player_defuse
The Periapt gives health, so player_spawn is the correct choice.
cmdbuy & cmdactivate
cmdbuy is executed when the player BUYS the item
cmdactivate is executed on the ITEMCONFIG event
In most cases, cmdactivate is empty or equal to cmdbuy.
For the Periapt, we want to give the player +50HP, so the code is:
es est_Health event_var(userid) + 50
For cmdactivate, its the same code !
Update:
With v0.76+, you can also restrict single items or even whole categories for a race, check the screenshot, there you see that Boots of Speed is restricted for Undead. (marked with (R))
Here some screenshots:
[attachment deleted by admin - older than 200 days!]






Germany

Logged




New Zealand




