Gfx disappear
1 reply



22.05.21 04:09:04 pm
Hi 
sometimes hat disappear... im not sure if its because Worn Weapons script or because there is too much gfx in the server but someone help me please the problem is annoying
My hats script :

sometimes hat disappear... im not sure if its because Worn Weapons script or because there is too much gfx in the server but someone help me please the problem is annoying

My hats script :
Code:
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
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
addhook("say","say_hat")
function say_hat(id,txt)
if (txt=="!angel") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/angel.png",1,1,200+id)
end
if (txt=="!dangerous") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/dangerous.png",1,1,200+id)
end
if (txt=="!devil") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/devil.png",1,1,200+id)
end
if (txt=="!headphones") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/headphones.png",1,1,200+id)
end
if (txt=="!nohat") then
freeimage(id)
end
if (txt=="!rock") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/rock.png",1,1,200+id)
end
if (txt=="!santa") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/santa.png",1,1,200+id)
end
if (txt=="!snowman") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/snowman.png",1,1,200+id)
end
end
function say_hat(id,txt)
if (txt=="!angel") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/angel.png",1,1,200+id)
end
if (txt=="!dangerous") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/dangerous.png",1,1,200+id)
end
if (txt=="!devil") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/devil.png",1,1,200+id)
end
if (txt=="!headphones") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/headphones.png",1,1,200+id)
end
if (txt=="!nohat") then
freeimage(id)
end
if (txt=="!rock") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/rock.png",1,1,200+id)
end
if (txt=="!santa") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/santa.png",1,1,200+id)
end
if (txt=="!snowman") then
freeimage(id)
id=image("gfx/~{Zombie}~/Hats/snowman.png",1,1,200+id)
end
end
edited 1×, last 22.05.21 04:22:05 pm
Bad Life
freeimage(id)
will try to remove the image which has the same ID as the player. This can work in some cases by coincidence but it's a bug in your script. "id" is always the player ID in this case because the

That you're assigning the result of



What you actually would have to do is creating a global array and saving the image ID of the hat image per player.
There are like 1000 hat scripts in the file archive. Take a look there.



