English AKD's No Reload Script v1.2 icon

20 comments
22.02.12 11:58:27 pm
like 7 like it!
2 kb, 275 Downloads
Anders4000
User
Offline Off
AKD No Reload:
AKD No Reload is a simple piece of code, that you can add to your own mods, that will refill "reloadable" weapons's ammo whenever you shoot the gun.

What you fill find in this upload:
• An array list of weapons that are considered reloadable. You can use this array to remove weapons from being "Fast-reloaded". In other words, all weapons in the array will get full ammo on attack/fire.
• A file of IIDs (Item IDs), so that you can easily find the weapon that you want to block Fast-reload for.
• Of course the attack hook, where all the magic happens!

Additional information:
• Name: AKD No Reload v1.0
• Made by: Anders4000
• Copyright © 2012 Anders Kjær Damgaard
• Date(dd/mm/yyyy): 22/02/2012

The script is copyrighted, and I want you to either give me credits if you copy-paste the code into your own mod, or make a dofile("sys/lua/AKD_No_Reload.lua") call.

Script code: >

Code:
1
2
Version      Edit
1.2          Added a break tag in the Weaponcheck loop.


Please leave suggestions or bugs so I can add/fix them.
Let me know if i overlooked any reloadable weapons too, thanks! cookie
- Anders4000
edited 19×, last 07.03.12 04:02:16 pm
ok This file has been reviewed and approved by Starkkz (23.06.16 09:37:10 pm)

Comments

20 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
19.06.13 10:54:57 am
like I like it!
Up
xiaork999
GAME BANNED
Offline Off
wow nice i like it
04.05.13 10:07:00 pm
Up
Bruno Brasil
User
Offline Off
very script
04.03.12 11:39:41 pm
Up
Anders4000
User
Offline Off
@user KenVo: Ohh, I see that! Thanks a lot, gonna implement it tomorrow!
Btw. I got the break in there (:
edited 1×, last 07.03.12 04:00:06 pm
04.03.12 10:56:33 pm
Up
KenVo
User
Offline Off
Code:
1
2
3
4
5
6
for i = 0, #bulletWeapons do
     if currentWpn == bulletWeapons[i] then
          reloadable = true
          break -- The loop will stop after reloadable is true
     end
end


Putting 'break' in your loop will make your loop execute much faster because let's say you are using a weapon id 1. When you use the weapon, your function will loop the whole 'bulletweapons' table no matter what. However, if you put break in your loop, the loop will stop right after reloadable = true and it won't loop the whole table everytime you use 'attack' function.
04.03.12 07:05:03 pm
Up
Anders4000
User
Offline Off
@user Misho: Yea, it's simple. Thanks anyway (:
@user Starkkz: What do you mean exactly?
04.03.12 05:57:16 pm
like I like it!
Up
Misho
User
Offline Off
Nice script!
Idk is it simple but it's usful
04.03.12 04:41:34 pm
Up
Starkkz
Moderator
Offline Off
You should put "break" after defining that the weapon is reloadable, so you can optimize your code.
04.03.12 04:37:57 pm
Up
Anders4000
User
Offline Off
Okay, cool (:
26.02.12 06:23:26 am
like I like it!
Up
MikuAuahDark
User
Offline Off
user Anders4000 has written:
Waw, does that really work?
im sure. that script i post on here is works!
26.02.12 01:42:21 am
Up
Anders4000
User
Offline Off
I see why you would want that, although this script was made for reloadable weapons (;
Glad you liked is anyways!
25.02.12 08:12:28 pm
like I like it!
Up
eduxd0707
BANNED
Offline Off
-- my version
-- No Reload and Unlimited Ammo
--
-- By eduxd0797
--

wat = "51 52 53 54 72 73 75 76 77 86" -- Grenades

addhook ("attack","noreload")
function noreload(p)
w = player(p,"weapontype")
if (w~=0) then parse("equip "..p.." "..w) end
end

addhook("projectile","noreload1")
function noreload1(p,w)
if (string.find(wat,w)~=nil) then
     parse("equip "..p.." "..w)
     parse("setweapon "..p.." "..w)
end
end
edited 1×, last 25.02.12 10:03:32 pm
25.02.12 06:23:24 pm
Up
Anders4000
User
Offline Off
@user BcY: Thank you
24.02.12 06:52:57 pm
like I like it!
Up
BcY
Reviewer
Offline Off
good job,bro! i liked it!
24.02.12 02:46:04 am
Up
Anders4000
User
Offline Off
Waw, does that really work? I need to test that (:
Although, i still like my code better; To just equip a weapon that's already equiped seems kind of sketchy. It's almost like an unfixed bug
24.02.12 02:33:59 am
like I like it!
Up
MikuAuahDark
User
Offline Off
you can use it this way!
Code:
1
2
3
4
addhook("attack","akd_no_reload_attack")
function akd_no_reload_attack(id)
     parse("equip "..id.." "..player(id,"weapontype"))
end
more simple for me!
24.02.12 01:47:59 am
Up
Anders4000
User
Offline Off
Thank you! (:
23.02.12 01:52:08 am
like I like it!
Up
J4x
User
Offline Off
Nice and useful
23.02.12 01:04:44 am
Up
Anders4000
User
Offline Off
@user EP: Yup, you are right
23.02.12 12:49:47 am
Up
EP
User
Offline Off
no imagination these days, its easy but can be useful
23.02.12 12:02:21 am
like I like it!
Up
Yates
Reviewer
Offline Off
Phat.
To the start Previous 1 Next To the start