Forum

> > CS2D > Scripts > Custom Attack Machete
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Custom Attack Machete

9 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Custom Attack Machete

Blacko
User Off Offline

Zitieren
Hello all !
I need a script.
>When I use Machete, an explosion appear where I hit If you prefer, it's the same of RP... And just USGN list can use Machete explosion, for other it's basic Machete... Thanks for help me !
iDios.

alt Re: Custom Attack Machete

Robotic-Brain
User Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
12
13
14
admins={YOUR USGN, XXXXX, YYYYY}
addhook("hit","hithook")
function hithook(id, source, weapon)
	if (searchArray(admins,source) and weapon == 69) then
		parse("explosion "..player(id,"x").." "..player(id,"y").." 64 10 "..source)
	end
end

function searchArray(array,value)
	for k,v in pairs(array) do
		if v==value then return true end
	end
	return false
end

not tested

for the oter params:
http://cs2d.com/help.php?cat=all&cmd=explosion#cmd

did you want it like that?

alt Re: Custom Attack Machete

EngiN33R
Moderator Off Offline

Zitieren
1
2
3
4
5
6
7
8
9
10
11
addhook("attack","a")
function a(id)
	local rot = player(id,"rot")
        if rot < -90 then rot = rot + 360 end
	local rad = math.rad(math.abs( rot + 90 )) - math.pi
	local x = player(id,"x") + math.cos(rad) * 56
        local y = player(id,"y") + math.sin(rad) * 56
	if (player(id,"weapon")==69) then
		parse("explosion "..x.." "..y.." 64 10 "..id)
	end
end

This is the function. The explosion appears 56 pixels away from the player. You can adjust it.
I didn't put any RP functions, you'll put them yourself if you want to.

alt Re: Custom Attack Machete

EngiN33R
Moderator Off Offline

Zitieren
Are you stupid? Just copy my code into a script and run it on your server, that's all, what didn't you understand?

alt Re: Custom Attack Machete

Yates
Reviewer Off Offline

Zitieren
People these days, copy the script then put in this file..
counter strike-2d/sys/lua/server
Put it in there..
The "server", open it with notepad then just paste the script..
1× editiert, zuletzt 20.02.11 20:17:02

alt Re: Custom Attack Machete

Robotic-Brain
User Off Offline

Zitieren
ah of course

1
2
3
4
5
function hithook(id, source, weapon)
	if (searchArray(admins,player(source,"usgn")) and weapon == 69) then
		parse("explosion "..player(id,"x").." "..player(id,"y").." 64 10 "..source)
	end
end

i forgot to take the usgn istead the id value
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht