Forum

> > CS2D > Scripts > NoReload fix.
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch NoReload fix.

11 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt NoReload fix.

Mora
User Off Offline

Zitieren
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?...

alt Re: NoReload fix.

eledah
User Off Offline

Zitieren
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
3× editiert, zuletzt 01.12.14 12:51:02

alt Re: NoReload fix.

Ajmin
User Off Offline

Zitieren
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.

alt Re: NoReload fix.

Mora
User Off Offline

Zitieren
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.

alt Re: NoReload fix.

Alistaire
User Off Offline

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

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

alt Re: NoReload fix.

Mora
User Off Offline

Zitieren
@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.

alt Re: NoReload fix.

eledah
User Off Offline

Zitieren
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
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht