Dateien

> > CS2D > Lua Scripts > AKD's No Reload Script v1.2
DateiübersichtCS2D-ÜbersichtLua Scripts-Übersicht

Englisch AKD's No Reload Script v1.2 >

20 Kommentare2 kb, 610 Downloads

alt AKD's No Reload Script v1.2

Anders4000
User Off Offline

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: >

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
19× editiert, zuletzt 07.03.12 16:02:16
Zugelassen von Starkkz

Download Download

2 kb, 610 Downloads

Kommentare

20 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

xiaork999
GAME BANNED Off Offline

wow nice i like it
Ich mag es!

alt

Anders4000
User Off Offline

@user KenVo: Ohh, I see that! Thanks a lot, gonna implement it tomorrow!
Btw. I got the break in there (:
1× editiert, zuletzt 07.03.12 16:00:06

alt

KenVo
User Off Offline

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.

alt

Misho
User Off Offline

Nice script!
Idk is it simple but it's usful
Ich mag es!

alt

Starkkz
Moderator Off Offline

You should put "break" after defining that the weapon is reloadable, so you can optimize your code.

alt

MikuAuahDark
User Off Offline

user Anders4000 hat geschrieben
Waw, does that really work?
im sure. that script i post on here is works!
Ich mag es!

alt

Anders4000
User Off Offline

I see why you would want that, although this script was made for reloadable weapons (;
Glad you liked is anyways!

alt

eduxd0707
BANNED Off Offline

-- 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
Ich mag es!
1× editiert, zuletzt 25.02.12 22:03:32

alt

BcY
Reviewer Off Offline

good job,bro! i liked it!
Ich mag es!

alt

Anders4000
User Off Offline

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

alt

MikuAuahDark
User Off Offline

you can use it this way!
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!
Ich mag es!

alt

J4x
User Off Offline

Nice and useful
Ich mag es!

alt

EP
User Off Offline

no imagination these days, its easy but can be useful

alt

Yates
Reviewer Off Offline

Phat.
Ich mag es!
Zum Anfang Vorherige 1 Nächste Zum Anfang