|
Post by Java on Jun 7, 2014 21:25:39 GMT 5.5
Hello, i'm got a Q when i'm chose a fist it show hats then atter i'm chose it not remove the old hats it still keep it, i'm khow how to to that can you help here is my lua:
addhook("serveraction","serveraction_hook") function serveraction_hook(id,act) if act==1 then menu(id,"Hats Menu,Builder,Cowboy,King,Skull,Smiley,No Hat") return end end
addhook("menu","save_menu") function save_menu(id,title,buton) if title == "Hats Menu" then if buton == 1 then freeimage(id) id1=image("gfx/Java Gfx/builder.png",1,1,200+id) imagealpha(id1,1.0) elseif buton == 2 then freeimage(id) id1=image("gfx/Java Gfx/cowboy.png",1,1,200+id) imagealpha(id1,1.0) elseif buton == 3 then freeimage(id) id1=image("gfx/Java Gfx/king.png",1,1,200+id) imagealpha(id1,1.0) elseif buton == 4 then freeimage(id) id1=image("gfx/Java Gfx/skull.png",1,1,200+id) imagealpha(id1,1.0) elseif buton == 5 then freeimage(id) id1=image("gfx/Java Gfx/smiley.png",1,1,200+id) imagealpha(id1,1.0) elseif buton == 6 then freeimage(id) imagealpha(id1,1.0) end end end
|
|
|
Post by Crusader on Jun 8, 2014 5:58:56 GMT 5.5
you mean the old hat is gone after roundstart isnt it? For changing its work perfectly just gone after roundstart
So what are the prob.?
|
|
|
Post by Java on Jun 8, 2014 7:30:59 GMT 5.5
Like This When i'm Chose a >>Fist Hats<< then i'm chose other Hats,but The Fist Hats i'm CHose din't get remove it keep show the Fist Gats Andd other HATS IS BUG HELP ME
|
|
|
Post by Crusader on Jun 8, 2014 7:35:17 GMT 5.5
really? it work perfectly for me weird
|
|
|
Post by Crusader on Jun 8, 2014 7:37:02 GMT 5.5
really? it work perfectly for me weird
|
|
|
Post by Java on Jun 8, 2014 8:48:56 GMT 5.5
but you can you make a new one with no bug any thing plsss i'm need it co DONE plssss i'm will give you creits*
|
|
|
Post by Crusader on Jun 8, 2014 16:44:17 GMT 5.5
but you can you make a new one with no bug any thing plsss i'm need it co DONE plssss i'm will give you creits* Personally I am recomended Infinite rain hat lua (That our server use) Its easy to configure and easy to add new hats This is, you juse need edit the name and image path, also the server action button if you want Credits to Infinite rain -- Infinite rain Hat
if f99 == nil then f99 = {} end
f99.hatscript = {hook = {}, hat = {}, nhat = {}}
f99.hatscript.hats = {
[1] = {name = "Angel", imagepath = "gfx/aRange/angel.png"}; -- The name is the name that showed in menu, and image path you know what is that [2] = {name = "Devil", imagepath = "gfx/aRange/devil.png"};
[3] = {name = "Gandalf", imagepath = "gfx/aRange/gandalf_hat.png"};
[4] = {name = "Graduation Hat", imagepath = "gfx/aRange/graduation_hat.png"};
[5] = {name = "Party Hat", imagepath = "gfx/aRange/party_hat.png"};
[6] = {name = "Pirate", imagepath = "gfx/aRange/pirate_hat.png"};
[7] = {name = "Pumpkin Hat", imagepath = "gfx/aRange/pumpkin_head.png"};
[8] = {name = "Santa", imagepath = "gfx/aRange/santa_hat.png"};
[9] = {name = "Snowman", imagepath = "gfx/aRange/snowman.png"};
[10] = {name = "Spear", imagepath = "gfx/aRange/spear.png"};
[11] = {name = "White Cap", imagepath = "gfx/aRange/White_cap.png"};
[12] = {name = "Black Beret", imagepath = "gfx/aRange/black_beret.png"};
[13] = {name = "Blue Beret", imagepath = "gfx/aRange/blue_beret.png"};
[14] = {name = "Green Beret", imagepath = "gfx/aRange/green_beret.png"};
[15] = {name = "Headcrab", imagepath = "gfx/aRange/headcrab.png"};
[16] = {name = "Headphone", imagepath = "gfx/aRange/headphones.png"};
[17] = {name = "Mario", imagepath = "gfx/aRange/mario.png"};
[18] = {name = "Luigi", imagepath = "gfx/aRange/luigi.png"};
[19] = {name = "Minecraft Zombie", imagepath = "gfx/aRange/mc-zombie.png"};
[20] = {name = "Smile", imagepath = "gfx/aRange/smile.png"};
}
f99.hatscript.hats[#f99.hatscript.hats + 1] = {name = "Remove hat", imagepath = "", terminate = true}
function f99.hatscript.selectmenu(id, page)
local page = page or 1
local pages = math.ceil(#f99.hatscript.hats / 6)
if page < 1 then page = pages end
if page > pages then page = 1 end
local m = 'Select a hat P'.. page
for i = 6 * page - 5, 6 * page do
if f99.hatscript.hats[i] then m = m ..', '.. f99.hatscript.hats[i].name else m = m ..',' end
end
if page == pages then m = m ..',,<<- First page' else m = m ..',,Next page -->' end
if page == 1 then m = m ..',Last page ->>' else m = m ..',<-- Previous page' end
menu(id, m)
end
addhook('serveraction', 'f99.hatscript.hook.serveraction')
function f99.hatscript.hook.serveraction(id, action)
if action == 2 then
f99.hatscript.selectmenu(id, 1)
end
end
addhook('menu', 'f99.hatscript.hook.menu')
function f99.hatscript.hook.menu(id, title, button)
if title:sub(1, 14) == 'Select a hat P' then
local page = tonumber(title:sub(15))
if button == 8 then f99.hatscript.selectmenu(id, page + 1) end
if button == 9 then f99.hatscript.selectmenu(id, page - 1) end
if button <= 6 then
if f99.hatscript.hats[(page - 1) * 6 + button].terminate then
if f99.hatscript.hat[id] then
freeimage(f99.hatscript.hat[id])
f99.hatscript.nhat[id] = false
f99.hatscript.hat[id] = false
end
else
if f99.hatscript.hat[id] then
freeimage(f99.hatscript.hat[id])
end
f99.hatscript.hat[id] = image(f99.hatscript.hats[(page - 1) * 6 + button].imagepath, 1, 0, 200 + id)
f99.hatscript.nhat[id] = f99.hatscript.hats[(page - 1) * 6 + button].imagepath
end
end
end
end
addhook('join', 'f99.hatscript.hook.join')
function f99.hatscript.hook.join(id)
f99.hatscript.hat[id] = false
f99.hatscript.nhat[id] = false
end
addhook('startround', 'f99.hatscript.hook.startround')
function f99.hatscript.hook.startround(mode)
for n, id in pairs(player(0, 'tableliving')) do
if f99.hatscript.nhat[id] then
f99.hatscript.hat[id] = image(f99.hatscript.nhat[id], 1, 0, 200 + id)
end
end
end
|
|
|
Post by Java on Jun 8, 2014 18:49:08 GMT 5.5
Thanks Crusader!!!
|
|
|
Post by Crusader on Jun 8, 2014 19:18:50 GMT 5.5
You're welcome, goodluck on whatever you do
|
|
|
Post by Electric on Jun 8, 2014 22:11:32 GMT 5.5
Where is our expert
|
|
|
Post by Crusader on Jun 9, 2014 10:04:36 GMT 5.5
Where is our expert Not here, somewhere else
|
|
|
Post by Electric on Jun 10, 2014 1:34:32 GMT 5.5
What catch him and put in our server dont leave him
|
|
|
Post by Electric on Jun 10, 2014 1:34:43 GMT 5.5
What catch him and put in our server dont leave him
|
|
|
Post by Java on Jun 10, 2014 8:58:21 GMT 5.5
hMM WHAT YOU TRY TO SAY Karthikviswa.
|
|
Night_stalk3r
Member
Posts: 82
ProuD to be Proud of mYself
Posts: 82
|
Post by Night_stalk3r on Jun 15, 2014 4:50:53 GMT 5.5
After reading all these codes i feel like DrunK . . .btw nyc work guys :-D
|
|