Forum

> > CS2D > Scripts > Unlimited Weapon
Forums overviewCS2D overview Scripts overviewLog in to reply

English Unlimited Weapon

11 replies
To the start Previous 1 Next To the start

old Unlimited Weapon

secritek
User Off Offline

Quote
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

old Re: Unlimited Weapon

Yates
Reviewer Off Offline

Quote
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)

old Re: Unlimited Weapon

secritek
User Off Offline

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

old Re: Unlimited Weapon

Yates
Reviewer Off Offline

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

old Re: Unlimited Weapon

Homam
User Off Offline

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


Ehm...

old Re: Unlimited Weapon

archmage
User Off Offline

Quote
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

old Re: Unlimited Weapon

Apache uwu
User Off Offline

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

I'm probably wrong lol

old Re: Unlimited Weapon

archmage
User Off Offline

Quote
No, no it is triggered before you pick it up.
sys/lua/info.txt has written
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

old Re: Unlimited Weapon

Homam
User Off Offline

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

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

old Re: Unlimited Weapon

Homam
User Off Offline

Quote
user secritek has written
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.
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview