English [R] Multiple Weapon Buy icon

17 comments
21.05.15 04:36:07 pm
like 4 like it!
614 b, 133 Downloads
Ridho
User
Offline Off
hi all

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

just edit the
Code:
1
jumlahminimum=2

"2" means total weapon that can be bought

Quote:
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
image
edited 4×, last 29.05.15 07:02:17 am
ok This file has been reviewed and approved by Infinite Rain (04.12.15 01:59:04 am)

Comments

17 comments
Goto Page
To the start Previous 1 Next To the start

Log in!

You need to log in to be able to write comments!Log in
22.12.16 08:21:21 pm
Up
Yassssuo
User
Offline Off
wat this script lol
01.07.15 03:14:25 am
Up
DaisukeOno
User
Offline Off
Don't see bad comments my friend, you're working hard for this. That is enough.
Quote:
Indonesian : jumlah minimum=2
English : minimum amount=2
27.05.15 11:12:58 am
Up
Ridho
User
Offline Off
user Yates Im newbie lua scripter, what's the matter

user Stinger Im too lazy to translate to english
26.05.15 11:15:05 pm
like I like it!
Up
Stinger
User
Offline Off
i like the "jumlahminimum" word at ur lua, lmao
26.05.15 06:08:59 pm
Up
Rainoth
Moderator
Offline Off
@user Yates: Decent coding. He just didn't add tabs.
26.05.15 04:16:52 pm
Up
BountyHunter
User
Offline Off
dis coding
26.05.15 02:15:39 pm
Up
Yates
Reviewer
Offline Off
dat coding
26.05.15 01:03:27 pm
like I like it!
Up
Captione
User
Offline Off
To be honest with you, it's 6 & 50. I looked at the script.
25.05.15 06:45:39 pm
Up
Ridho
User
Offline Off
user Captione yes, you can edit it but I think it's not really fun to buy many postols, in the script there's
Code:
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
22.05.15 10:58:06 pm
like I like it!
Up
VADemon
User
Offline Off
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.
22.05.15 10:36:17 pm
Up
Talented Doge
User
Offline Off
Rewritten your code
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...
edited 1×, last 22.05.15 10:57:33 pm
22.05.15 09:34:51 pm
Up
Pehlivan
User
Offline Off
@user Captione: Nope, it can't or just with primary weapons (FAQ)
22.05.15 07:25:41 pm
like I like it!
Up
Captione
User
Offline Off
@user Ridho: Currently using it. Can it do the same with nades, pistols, shields or non buy-able weapons?
22.05.15 02:23:32 am
Up
Ridho
User
Offline Off
user Pseudon ya, the weapon won't dropped unless the "jumlahminimum" is reached, if It happened, the older weapon will be dropped
21.05.15 10:19:11 pm
like I like it!
Up
Pseudon
User
Offline Off
It does so? If it does so, ok.
21.05.15 04:46:21 pm
Up
Ridho
User
Offline Off
user Talented Doge ew I forget to check it, I'll fix it soon, thanks
21.05.15 04:38:16 pm
Up
Talented Doge
User
Offline Off
The players can buy for no cost...
To the start Previous 1 Next To the start