Forum

> > CS2D > Scripts > NoReload fix.
Forums overviewCS2D overview Scripts overviewLog in to reply

English NoReload fix.

11 replies
To the start Previous 1 Next To the start

old NoReload fix.

Mora
User Off Offline

Quote
Hi all,
I know this fcken script "no reload" it's a .
But i got one problem:
1
2
3
4
5
6
addhook("attack","no_reload_attack")
function no_reload_attack(id)
	if thereload[id]==1 then
     parse("equip "..id.." "..player(id,"weapontype"))
	end
end
it's the code, work perfect, but when i throw grenades i got this :
IMG:https://i9.pixs.ru/storage/2/7/4/Bezimyanni_7172463_14966274.png

does any knows how to fix?...

old Re: NoReload fix.

eledah
User Off Offline

Quote
What do you exactly want? To make that error go away? or just have the server to equip players with grenades as they use it?


Edit: Use this code
1
2
3
4
5
6
7
8
addhook("reload", "_reload")
function _reload(id, mode)
	weptype = player(id, "weapontype")
	if mode == 1 then
		parse("equip " .. id .. " " .. weptype)
		parse("setweapon " .. id .. " " .. weptype)
	end
end
edited 3×, last 01.12.14 12:51:02 pm

old Re: NoReload fix.

Ajmin
User Off Offline

Quote
1
2
3
4
5
6
7
8
addhook("reload","neverreload")
function neverreload(id,mode)
wp = player(id,"weapontype")
     if mode==1 then
          parse("equip "..id.." "..wp)
          parse("setweapon "..id.." "..wp)
     end
end

plse search before posting.

old Re: NoReload fix.

Mora
User Off Offline

Quote
This will be good?
1
2
3
4
5
6
7
8
addhook("reload","when_reload")
function when_reload(id,mode)
yourweapon = player(id,"weapontype")
	if mode==1 then
		parse("equip "..id.." "..yourweapon)
		parse("setweapon "..id.." "..yourweapon)
	end
end
P.s-@user Ajmin: i'm ask as "ATTACK" hook, if you read my topic correctly -.-, but i will use that.

old Re: NoReload fix.

Alistaire
User Off Offline

Quote
1
2
3
4
5
6
addhook('attack', '_attackFunc')

function _attackFunc(id, wpn)
	parse('equip '..id..' '..wpn)
	parse('setweapon '..id..' '..wpn)
end

old Re: NoReload fix.

Mora
User Off Offline

Quote
@user Alistaire: That "weapon" asks exactly how you called it... You should add "local" for it.
IMG:https://i9.pixs.ru/storage/8/3/8/Bezimyanni_6587940_14969838.png

even if i add that local it wont work. You can test it.

old Re: NoReload fix.

eledah
User Off Offline

Quote
1
2
3
4
5
6
7
8
addhook("attack", "_attack")
function _attack(id)
	local weptype = player(id, "weapontype")
	if weptype ~= 0 then
		parse("equip " .. id .. " " .. weptype)
		parse("setweapon " .. id .. " " .. weptype)
	end
end
To the start Previous 1 Next To the start
Log in to reply Scripts overviewCS2D overviewForums overview