Forum

> > CS2D > Scripts > Point Script Request
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Point Script Request

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Point Script Request

kerker
User Off Offline

Zitieren
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:
Mehr >

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

alt Re: Point Script Request

Baloon
GAME BANNED Off Offline

Zitieren
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?

alt Re: Point Script Request

THEMUD
User Off Offline

Zitieren
Try this code below:
Mehr >

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.

alt Re: Point Script Request

Yunuu
User Off Offline

Zitieren
user THEMUD hat geschrieben
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

alt Re: Point Script Request

THEMUD
User Off Offline

Zitieren
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:
Mehr >

alt Re: Point Script Request

GeoB99
Moderator Off Offline

Zitieren
@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.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht