Admin/mod comment
Removed useless symbols in the topic title. /
GeoB99
Scripts
hats bug/glitch/error :/
hats bug/glitch/error :/
1

GeoB99 i have problem with math but i hate math, i tried solving it, but i can't. can anyone fix math for me?
VADemon has writteni have problem with math but i hate math, i tried solving it, but i can't. can anyone fix math for me?
VADemon has writtenaddhook("say","anything")
function anything(id,txt)
if (txt=="!hat") then
freeimage(id)
id=image("gfx/hats_menu/hat1.png",1,1,200+id)
return 1
end
if (txt=="!hat2") then
freeimage(id)
id=image("gfx/hats_menu/hat2.png",1,1,200+id)
return 1
end
end
function new_players_array()
local players = {}
for id=1,32 do
players[id] = {image = nil} -- player's "properties"
end
return players
end
players = new_players_array()
addhook("say","anything")
function anything(id, txt)
local player = players[id]
if (txt=="!hat") then
if player.image then
freeimage(player.image)
player.image = nil
end
player.image = image("gfx/hats_menu/hat1.png",1,1,200+id)
return 1
end
if (txt=="!hat2") then
if player.image then
freeimage(player.image)
player.image = nil
end
player.image = image("gfx/hats_menu/hat2.png",1,1,200+id)
return 1
end
end
image
freeimage.
image function returns the image's ID, which is the argument for the
freeimage function. At the end of the
freeimage function's help page it says that you must set the variable where you've stored the image's ID to nil (after freeing the image) for your code to work properly.
Zeik said, copy this code below and paste it after the 34 line in
Zeik's code.function FadeImageLeave(id)
if ( player.image ) then
freeimage(player.image)
player.image = nil
end
end
function FadeImageDie(victim)
if ( player.image ) then
freeimage(player.image)
player.image = nil
end
end
addhook('leave', 'FadeImageLeave')
addhook('die', 'FadeImageDie')
1
