Forum

> > CS2D > Scripts > Point Script Request
Forums overviewCS2D overview Scripts overviewLog in to reply

English Point Script Request

7 replies
To the start Previous 1 Next To the start

old Point Script Request

kerker
User Off Offline

Quote
Hello again!
I need a script associated with points. Don't understand?Here's what to do:
For each kill the player is given one point. These points can be exchanged at the store for weapons.List of weapons here:
More >

Help, please.
P.S: I see this script on another server (forgot name), but I don't find this script in file archive.

old Re: Point Script Request

Baloon
GAME BANNED Off Offline

Quote
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
point={}
for a=1,32 do
	point[a]=0
end

addhook("kill","killhook")
function killhook(id)
	point[id]=point[id]+1
end

addhook("serveraction","actionhook")
function actionhook(id,b)
	if b==1	-- OPTIONAL
		menu(id,"Weapon Store,Gas Mask | 5 POINTS,Kevlar and Helmet | 10 POINTS,P228| 5 POINTS,FIVESEVEN | 10 POINTS,MAC 10|25 POINTS,AK47| 40 POINTS")
	end
end

addhook("menu","menuhook")
function menuhook(id,title,b)
And so on, it's self explanatory. Also, is able to equip gas masks?

old Re: Point Script Request

THEMUD
User Off Offline

Quote
Try this code below:
More >

I added the leave hook intentionally. Because without it the points of the player who left will be still occupied, and if someone joins next he might take his place and hence will take his points.

old Re: Point Script Request

Yunuu
User Off Offline

Quote
user THEMUD has written
1
parse("equip "..id.." 60"); --Though it's unable to be taken


I think this can be more easier, but it works
1
2
3
4
5
6
function equipgasmask(id)
parse("spawnitem 60 "..player(id,"tilex").." "..player(id,"tiley"))
local x,y = player(id,"x"),player(id,"y")
parse("setpos "..id.." 1 1")
parse("setpos "..id.." "..x.." "..y)
end

old Re: Point Script Request

THEMUD
User Off Offline

Quote
I found that I forgot to decrease the PRICE of the weapon from the points when purchasing, so I added it. Also I didn't fully understand what you are saying, but I gathered a little clue in summary, which is showing the points on the screen. Furthermore, I added @user Yunuu's snippet to the code as well. The full code:
More >

old Re: Point Script Request

GeoB99
Moderator Off Offline

Quote
@user THEMUD: In my opinion cs2d lua hook second would fit instead of ms100 because it wouldn't make much sense to use this hook to display such HUD and thus, needless computation. Of course, I could be wrong.

old Re: Point Script Request

Rainoth
Moderator Off Offline

Quote
@user GeoB99: You don't even need second for this. You don't need any hooks. Just change the hud every time the point amount changes.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview