Dateien

> > CS2D > Lua Scripts > [R] Multiple Weapon Buy
DateiübersichtCS2D-ÜbersichtLua Scripts-Übersicht

Englisch [R] Multiple Weapon Buy >

17 Kommentare614 b, 508 Downloads

alt [R] Multiple Weapon Buy

Ridho
User Off Offline

hi all

this is an easy script, only 43 lines
this script allows player to buy multiple weapons without dropping,

just edit the
1
jumlahminimum=2
"2" means total weapon that can be bought

Zitat
Q: why only primary weapons!?
A: you can edit it by yourself


Rules
• You can use it, edit it,
or even reupload it (if you are brave enough to against the rules ) anyway I don't really care about it

FIXED
@user Talented Doge for finding free buy bug

thank you cookies
4× editiert, zuletzt 29.05.15 07:02:17
Zugelassen von Infinite Rain

Download Download

614 b, 508 Downloads

Kommentare

17 Kommentare
Zum Anfang Vorherige 1 Nächste Zum Anfang

Logge dich ein!

Du musst dich einloggen, um selber Kommentare verfassen zu können!Einloggen

alt

DaisukeOno
User Off Offline

Don't see bad comments my friend, you're working hard for this. That is enough.
Zitat
Indonesian : jumlah minimum=2
English : minimum amount=2

alt

Ridho
User Off Offline

user Yates Im newbie lua scripter, what's the matter

user Stinger Im too lazy to translate to english

alt

Stinger
User Off Offline

i like the "jumlahminimum" word at ur lua, lmao
Ich mag es!

alt

Rainoth
Moderator Off Offline

@user Yates: Decent coding. He just didn't add tabs.

alt

Yates
Reviewer Off Offline

dat coding

alt

Captione
User Off Offline

To be honest with you, it's 6 & 50. I looked at the script.
Ich mag es!

alt

Ridho
User Off Offline

user Captione yes, you can edit it but I think it's not really fun to buy many postols, in the script there's
1
weapon>6 and weapon <41     --If Im not forgot
it means weapon with id above 6 and below 41 (id 7 to 40) is allowed to buy multply

user VADemon I tried to find how to collect the dropped weapon when a player already has an equipped weapon, but I failed

alt

VADemon
User Off Offline

user Talented Doge you forgot to check whether the player has enough money

I like the idea, but there's room for improvement. When it's possible to buy multiple weapons then the players must be able to pick up additional (up to the limit) weapons.
Ich mag es!

alt

Talented Doge
User Off Offline

Rewritten your code
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
limit = {}
limit.prim = {}
limit.sec = {}
primary_limit = 2
secondary_limit = 2

addhook("spawn", "_s")
addhook("buy", "_b")

function _s(p)
	limit.prim[p], limit.sec[p] = 0, 0
end

function _b(p, w)
	local m = player(p, "money") - itemtype(w, "price")
	if w >= 10 and w <= 40 then
		if limit.prim[p] < primary_limit and player(p, "money") >= m then
			limit.prim[p] = limit.prim[p] + 1
			buyit (p, w, m)
			return 1
		else return 0 end
	elseif w >= 1 and w <= 6 then
		if limit.sec[p] < secondary_limit and player(p, "money") >= m then
			limit.sec[p] = limit.sec[p] + 1
			buyit (p, w, m)
			return 1
		else return 0 end
	end
end

function buyit(p, w, m)
	parse ("setmoney "..p.." "..m)
	parse ("equip "..p.." "..w)
	parse ("setweapon "..p.." "..w)
end

I added checking secondary weapon, but not grenades, because rebuying grenades is...
1× editiert, zuletzt 22.05.15 22:57:33

alt

Pehlivan
User Off Offline

@user Captione: Nope, it can't or just with primary weapons (FAQ)

alt

Captione
User Off Offline

@user Ridho: Currently using it. Can it do the same with nades, pistols, shields or non buy-able weapons?
Ich mag es!

alt

Ridho
User Off Offline

user Pseudon ya, the weapon won't dropped unless the "jumlahminimum" is reached, if It happened, the older weapon will be dropped

alt

Pseudon
User Off Offline

It does so? If it does so, ok.
Ich mag es!

alt

Talented Doge
User Off Offline

The players can buy for no cost...
Zum Anfang Vorherige 1 Nächste Zum Anfang