Forum

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

Englisch Unlimited Weapon

11 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Unlimited Weapon

secritek
User Off Offline

Zitieren
Hi all, i need help, i am making singleplayer map and i need the script that will allow you to take more primary weapons than one. Pls help me or at least tell me what is wrong on this one:
1
2
3
4
5
addhook("walkover","unlimitwpn-")
function unlimitwpn(id,iid,type,ain,a,m-ode)
parse("equip "..id.." "..type)
parse("removeitem "..type)
end

alt Re: Unlimited Weapon

Yates
Reviewer Off Offline

Zitieren
When you walk over a weapon. The lua should somehow detect the ID, and equip it.
That would work, but idk about removing the weapon you just walked over (From the map)

alt Re: Unlimited Weapon

secritek
User Off Offline

Zitieren
yeah thats the mayor problem also the lua i posted isnt working even in equiping or removing

alt Re: Unlimited Weapon

Yates
Reviewer Off Offline

Zitieren
No shit Sherlock. You added a '-' in the addhook. And it's gone in the function.

alt Re: Unlimited Weapon

Homam
User Off Offline

Zitieren
Zitat
addhook("walkover","unlimitwpn-") -- Remove the - . Done.
function unlimitwpn


Ehm...

alt Re: Unlimited Weapon

archmage
User Off Offline

Zitieren
I think this is what you want...

1
2
3
4
5
addhook("walkover", "unlimwpn")
function unlimwpn(id,iid)
	parse("equip "..id.." "..iid)
	return 1
end

alt Re: Unlimited Weapon

Apache uwu
User Off Offline

Zitieren
I'm not sure it will trigger since it doesn't trigger unless you actually get the weapon.

I'm probably wrong lol

alt Re: Unlimited Weapon

archmage
User Off Offline

Zitieren
No, no it is triggered before you pick it up.
sys/lua/info.txt hat geschrieben
walkover(id,iid,type,ain,a,mode) on walking over an item
-id: player id
-iid: item id
-type: item type
-ain: ammo in weapon / item count
-a: additional ammo
-mode: item mode
>return: 0 - proceed normally (collect?)
1 - don't collect

alt Re: Unlimited Weapon

Homam
User Off Offline

Zitieren
There's also a - in mode. Lol.

1
function unlimitwpn(id,iid,type,ain,a,m[-]ode)

alt Re: Unlimited Weapon

Homam
User Off Offline

Zitieren
user secritek hat geschrieben
nothing works


1
2
3
4
5
addhook("walkover","unlimitwpn")
 function unlimitwpn(id,iid,type,ain,mode)
 parse("equip "..id.." "..type)
 parse("removeitem "..type)
 end
Try it, I'm not sure.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht