Forum

> > CS2D > Scripts > Hats Menu Bug
ForenübersichtCS2D-Übersicht Scripts-ÜbersichtEinloggen, um zu antworten

Englisch Hats Menu Bug

16 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Hats Menu Bug

DarkZBrine
User Off Offline

Zitieren
Hi Guys i made an hats mod lua for cs2d and it's works
fine but when i choose one hat the gfx won't load i check everything in the file looks fine look

Mehr >

alt Re: Hats Menu Bug

RedizGaming
GAME BANNED Off Offline

Zitieren
@user DarkZBrine:
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
36
37
38
39
addhook("serveraction","hat1")
function hat1(id,b)
     if player(id,"team")==2 then
          if b==3 then
               menu(id,"Hats,Crate,HeadCrab,Light,Steve,Herobrine,Nothing")
          end
     end
end

-- Menu
addhook("menu","hat2")
function hat2(id,t,b)
     if t=="Hats" then
           if b == 1 then
                image("gfx/Hats/crate.png",1,1,200+id)
           elseif b == 2 then
                image("gfx/Hats/headcrab.png",1,1,200+id)
           elseif b == 3 then
                freeimage(id)
                image("gfx/Hats/light.png",1,1,200+id)
           elseif b == 4 then
                image("gfx/Hats/steve.png",1,1,200+id)
           elseif b == 5 then
                image("gfx/Hats/herobrine.png",1,1,200+id)
           elseif b == 6 then
                freeimage(id)
           end
     end 
end

-- Info Msg
addhook("minute","hat3")
function hats3()
     msg("== Hats Mod ==")
     msg("Author: DarkZBrine")
     msg("Lua: DarkZBrine")
     msg("Press F4 To Choose Hats")
     msg("==============")
end

alt Re: Hats Menu Bug

RedizGaming
GAME BANNED Off Offline

Zitieren
@user DarkZBrine:
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
36
37
38
39
40
41
42
43
44
45
46
47
addhook("serveraction","hat1")
addhook("menu","hat2")
addhook("minute","hat3")

function hat1(id,act,team)
	if act == 3 then
		if player(id,'team') == 2 then
			menu(id,'Hats,Crate,HeadCrab,Light,Steve,Herobrine,Nothing')
		end
	end
end

function hat2(id,title,b)
	if title == "Hats" then
		if b == 1 then
			freeimage(id)
			id=image("gfx/Hats/crate.png",1,1,200+id)
		end
		if b == 2 then
			freeimage(id)
			id=image("gfx/Hats/headcrab.png",1,1,200+id)
		end
		if b == 3 then
			freeimage(id)
			id=image("gfx/Hats/light.png",1,1,200+id)
		end
		if b == 4 then
			freeimage(id)
			id=image("gfx/Hats/steve.png",1,1,200+id)
		end
		if b == 5 then
			freeimage(id)
			id=image("gfx/Hats/herobrine.png",1,1,200+id)
		end
		if b == 6 then
			freeimage(id)
		end
	end
end

function hat3()
	msg("©000097000== Hats Mod ==")
	msg("©000097000Author: DarkZBrine")
	msg("©000097000Lua: DarkZBrine")
	msg("©000097000Press F4 To Choose Hats")
	msg("©000097000==============")
end

alt doesn't work too

DarkZBrine
User Off Offline

Zitieren
@user RedizGaming:

√ Crate
> But The Others When I select other slot it disapeard
i mean like i have deagle when i choose another gun or knife
the hat gone!
1× editiert, zuletzt 16.10.14 17:09:50

alt Reply

DarkZBrine
User Off Offline

Zitieren
Heres My Full Script DC Can You FIx It?

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
36
37
38
39
40
41
42
43
44
45
46
47
addhook("serveraction","hat1")
addhook("menu","hat2")
addhook("minute","hat3")

function hat1(id,act,team)
     if act == 3 then
          if player(id,'team') == 2 then
               menu(id,'Hats,Crate,HeadCrab,Light,Steve,Herobrine,Nothing')
          end
     end
end

function hat2(id,title,b)
     if title == "Hats" then
          if b == 1 then
               freeimage(id)
               id=image("gfx/Hats/crate.png",1,1,200+id)
          end
          if b == 2 then
               freeimage(id)
               id=image("gfx/Hats/headcrab.png",1,1,200+id)
          end
          if b == 3 then
               freeimage(id)
               id=image("gfx/Hats/light.png",1,1,200+id)
          end
          if b == 4 then
               freeimage(id)
               id=image("gfx/Hats/steve.png",1,1,200+id)
          end
          if b == 5 then
               freeimage(id)
               id=image("gfx/Hats/herobrine.png",1,1,200+id)
          end
          if b == 6 then
               freeimage(id)
          end
     end
end

function hat3()
     msg("©000097000== Hats Mod ==")
     msg("©000097000Author: DarkZBrine")
     msg("©000097000Lua: DarkZBrine")
     msg("©000097000Press F4 To Choose Hats")
     msg("©000097000==============")
end

alt Re: Hats Menu Bug

TopNotch
User Off Offline

Zitieren
You can't run freeimage(id) when no image has been loaded yet.
There are many hat scripts in the File Archive, why don't you use one of them?
EDIT: Your code fixed:
Spoiler >

Didn't test, should work.
1× editiert, zuletzt 17.10.14 09:22:10

alt Re: Hats Menu Bug

TopNotch
User Off Offline

Zitieren
Edited the code, I forget to add "checkHat(id) on every button. Should work properly now.

alt Re: Hats Menu Bug

DarkZBrine
User Off Offline

Zitieren
topnotch thew checkhat function what is the addhook of that is addhook("menu","checkHat")?

alt Re: Hats Menu Bug

DarkZBrine
User Off Offline

Zitieren
but still the disame the last hat still stays when i choose a new hat
1× editiert, zuletzt 17.10.14 09:53:13

alt Re: Hats Menu Bug

TopNotch
User Off Offline

Zitieren
Tested it myself, and it worked. Are you sure you copied the last version of my script (edited today)?

alt Re: Hats Menu Bug

DarkZBrine
User Off Offline

Zitieren
Tnx Top Notch But How Do I activate in Terrorist i find a way to the script and gives me errors so i go back to the old script only works for ct i was hope to fix it for terrorist too but i can't sorry
2× editiert, zuletzt 17.10.14 17:20:34
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Scripts-ÜbersichtCS2D-ÜbersichtForenübersicht