What is this
More
Its a shop where you can buy all kind of stuff (see list below) and to buy those you need points, you get points by killing enemies and you will also get some for free every minute.
How to use
More
Type !shop in chat and the shop menu will pop up and !shophelp to see info about it.
You can also bind it to a key like this: bind <key> "say !shop"
You can also bind it to a key like this: bind <key> "say !shop"
Updates lastest update: 06-01-2013 00:53
More
(06-01-2013 00:53) Removed wrapper because it broke bots
(06-01-2013 00:53) Fixed error when playing with bots
(04-01-1013 20:47) Fixed missing comma breaking all the code
(03-01-2013 18:08) Added pointId settings to change id of hud text
(03-01-2013 16:15) Changed/removed useless loop
(06-01-2013 00:53) Fixed error when playing with bots
(04-01-1013 20:47) Fixed missing comma breaking all the code
(03-01-2013 18:08) Added pointId settings to change id of hud text
(03-01-2013 16:15) Changed/removed useless loop
Settings
More
This shop got settings that you can change in the Lua file. Open the shop.lua with a text editor and you will see this code at top:
Just edit that to your liking.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
local settings = --Settings { 	--Shop menu settings 	menuTitle = "Shop", --Title of menu 	menuPageNext = "Next page", --Text of next page button 	menuPagePrev = "Previous page", --Text of previous page button 	 	--Chat command settings 	commandShop = "shop", --Chat command to open shop (dont include "!") 	commandHelp = "shophelp", --Chat command to see shop help? (dont include "!") 	helpColor = "000200000", --Color the help text got 	hideCommands = 1, --Hide chat commands? (1 = yes, 0 = no) 	 	--Point settings 	startPoints = 100, --Amount of points each player got at start 	killPoints = 15, --Amount per kill, the amount will be a random one between the 2 numbers 	freePointsTime = 60, --How many secs between each player get free points 	freePointsAmount = 10, --The amount of money they get each time 	 	--HUD settings 	pointId = 10, --The id of this hud text, if it dont shop up in server you may need to change it 	pointText = "Points: ", --Text in front of the point number 	pointColor = "200200000", --Color the point text got 	pointPos = {10, 200}, --The x and y position of the text 	 	--No money settings 	noMoneyText = "You dont have enough points!", --Text it will say if the player dont have enough money 	noMoneyColor = 255000000 --Color of text for no money }
Just edit that to your liking.
Adding items to the shop
More
Its also easy to add new items to the shop. Just add this code after (or before) the other added items near line 100:
If you want to add a custom item you can do
the price is a number and you can do whatever you like at the --Do stuff just like normal code and the id is the id of a player.
Example of a glow item
And if you just want to add a weapon you can do
they are both numbers and heres a example of the Flamethrower
If you want to add a custom item you can do
1
2
3
2
3
AddItem("Item name", price, function(id) 	--Do stuff end)
Example of a glow item
1
2
3
4
5
6
7
2
3
4
5
6
7
AddItem("White glow", 10, function(id) 	local glow = image("gfx/sprites/flare2.bmp", 0, 0, 100+id) 	imagecolor(glow, 255, 255, 200) 	imagescale(glow, 0.7, 0.7) 	imageblend(glow, 1) 	imagealpha(glow, 0.5) end)
And if you just want to add a weapon you can do
1
AddItemWeapon(weaponId, price)
1
AddItemWeapon(46, 80) --Flamethrower
Default item list
More
Page 1
Flamethrower | 150 points
RPG | 300 points
Portal gun | 400 points
Laser | 500 points
Grenade Launcher | 500 points
M134 | 450 points
Page 2
White glow | 10 points
Red glow | 10 points
Green glow | 10 points
Blue glow | points
Headcrab hat | 15 points
Snark hat | 15 points
Page 3
Wrench | 100 points
Chainsaw | 35 points
Claw | 25 points
Machete | 30 points
Molotov Cocktail | 40 points
Tactical Shield | 30 points
Page 4
Light Armor | 25 points
Armor | 50 points
Heavy Armor | 75 points
Medic Armor | 60 points
Super Armor | 95 points
Stealth Suit | 150 points
Flamethrower | 150 points
RPG | 300 points
Portal gun | 400 points
Laser | 500 points
Grenade Launcher | 500 points
M134 | 450 points
Page 2
White glow | 10 points
Red glow | 10 points
Green glow | 10 points
Blue glow | points
Headcrab hat | 15 points
Snark hat | 15 points
Page 3
Wrench | 100 points
Chainsaw | 35 points
Claw | 25 points
Machete | 30 points
Molotov Cocktail | 40 points
Tactical Shield | 30 points
Page 4
Light Armor | 25 points
Armor | 50 points
Heavy Armor | 75 points
Medic Armor | 60 points
Super Armor | 95 points
Stealth Suit | 150 points
How to install
More
Solution 1
Extract the lua-file to <Counter-Strike 2D>/sys/lua/autorun
The lua script will be loaded when you start a Counter-Strike 2D server the next time!
Solution 2
Extract the lua-file to <Counter-Strike 2D>/sys/lua
Open <Counter-Strike 2D>/sys/lua/server.lua with a text editor
Add this line at the end of the file: Save and close server.lua
The lua script will be loaded when you start a Counter-Strike 2D server the next time!
Extract the lua-file to <Counter-Strike 2D>/sys/lua/autorun
The lua script will be loaded when you start a Counter-Strike 2D server the next time!
Solution 2
Extract the lua-file to <Counter-Strike 2D>/sys/lua
Open <Counter-Strike 2D>/sys/lua/server.lua with a text editor
Add this line at the end of the file:
1
dofile("sys/lua/shop.lua")
The lua script will be loaded when you start a Counter-Strike 2D server the next time!
edited 16×, last 22.05.13 09:38:32 pm
Approved by EngiN33R
Download
3 kb, 1,010 Downloads