Forum

> > CS2D > Scripts > Magnific-Weapon
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Magnific-Weapon

5 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Magnific-Weapon

Marcell
Super User Off Offline

Zitieren
Welcome!
I got this idea today, when you click with "portal-gun" to the enemy that will drop all weapons and move it to you..

Can i do it somehow?
I already did it:

The dropping part bad..i think please help!

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
30
31
32
33
34
35
36
37
--------------------------------------------------------
--------------------------------------------------------
-------------- MAGNIFIC WEAPON SCRIPT ------------------
------------------  BY THE ANONYMUS  -------------------
--------------------------------------------------------


addhook("serveraction", "server_menu")
function server_menu(id, act)
 if(act==1) then
 menu(id, "Special Weapons Menu, Magnific Weapon|5000$")
 end
 end
 
addhook("menu", "buy_menu")
function buy_menu(id, title, button)
if title=="Special Weapons Menu" then
if button==1 then
if player(id,"money")>=5000 then
		parse("equip "..id.." 88")
		msg2(id,"©000255000You successfully bought Magnific Weapon!@C")
		parse("setmoney "..id.." "..(player(id,"money")-5000))
	else
		msg2(id,"©255000000You have insufficient funds!@C")

end
end
end
end


addhook("drop", "mgw")
function mgw(id, x, y)
         if(weapon==88) then
         parse("drop "..id.." "..x.." "..y.."")     
         end
end

alt Re: Magnific-Weapon

Rainoth
Moderator Off Offline

Zitieren
Quite hard to get what you want.

• "drop" doesn't have any parameters. It just makes person drop what he has currently. It won't work that way...
• You check which weapon it is so you should make
1
2
function mgw(id,iid,type,ain,a,mode,x,y)
	if iid == 88 then
But this sounds like nothing you want to do, it would just do something when you drop your own portal gun.

I would help you but I need someone to tell me how to check if the portal is certain player's.

If there's just one player who has this ability then you have to use
1
2
3
4
5
6
7
addhook("movetile","potato")
function potato(id,x,y)
	if x == object(22,"x") and y == object(22,"y") or x==object(23,"x") and y==object(23,"y") then
		parse("spawnitem "..player(id,"weapontype").." "..x.." "..y)
		parse("strip "..id.." "..player(id,"weapontype"))
	end
end

But that would probably make person who steps on portal lose his currently equiped weapon..

alt Re: Magnific-Weapon

Marcell
Super User Off Offline

Zitieren
i want that if you shot to someone, that will drop his all weapons and move it to me

alt Re: Magnific-Weapon

Yates
Reviewer Off Offline

Zitieren
Check cursor pos on map and all player locations. Then return hit hook (So the gun does not fire) and setpos any player where you just clicked towards you.

Magnificently simple.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht