Post by Java on Jun 17, 2014 17:10:28 GMT 5.5
function table.find(tab,value)
for i = 1, #tab do
if tab[i] == value then
return true
end
end
end
function table.find(t,v)
for _k,_v in pairs(t) do
if _v == v then
return _k
end
end
end
function initArray(m)
local array = {}
for i = 1, m do
array[i]=0
end
return array
end
ammopack=initArray(32)
function string.split(text,b)
local cmd = {}
if b then
b = b
else
b = "%s"
end
b = "[^"..b.."]+"
for o in string.gmatch(text,b) do
table.insert(cmd,o)
end
return cmd
end
function totable(t,match)
local cmd = {}
if not match then match = "[^%s]+" end
for word in string.gmatch(t, match) do
table.insert(cmd, word)
end
return cmd
end
addhook("kill","save_kill")
function save_kill(id)
ammopack[id]=ammopack[id]+2
end
addhook("join","join_ammo")
function join_ammo(id)
ammopack[id]=0
end
addhook("ms100","save_hud")
function save_hud()
for id = 1,32 do
if (player(id,"exists")) then
parse('hudtxt2 '..id..' 45 "©30 144255Ammopack ©255255000: '..ammopack[id]..' " 0 130')
end
end
end
addhook("serveraction","_serveraction")
function _serveraction(id,action)
if action == 2 then
if player(id,"team")==2 then
menu(id,"Humain Shop,Laser Mine| 10,Mine| 10,Satchel charger| 20,,Armor| 20,Heavy Armor| 30,FnF2000| 30,SG-552| 15")
end
end
end
addhook("menu","menuuus")
function menuuus(id,title,button)
if title == "Humain Shop" then
if button == 1 then
if ammopack[id] >= 10 then
if table.find(playerweapons(id),87) then
msg2(id,"©255000000You already own this item!")
else
parse("equip "..id.." 87")
msg2(id,"©000255000You bought Laser Mine!")
ammopack[id] = ammopack[id] - 10
end
else
msg2(id,"©255000000You don't have enough ammopack!")
end
elseif button == 2 then
if ammopack[id] >= 10 then
if table.find(playerweapons(id),77) then
msg2(id,"©255000000You already own this item!")
else
parse("equip "..id.." 77")
msg2(id,"©000255000You bought Mine!")
ammopack[id] = ammopack[id] - 10
end
else
msg2(id,"©255000000You don't have enough ammopack!")
end
elseif button == 3 then
if ammopack[id] >= 20 then
if table.find(playerweapons(id),89) then
msg2(id,"©255000000You already own this item!")
else
parse("equip "..id.." 89")
msg2(id,"©000255000You bought Shatchel Charger!")
ammopack[id] = ammopack[id] - 20
end
else
msg2(id,"©255000000You don't have enough ammopack!")
end
elseif button == 5 then
if ammopack[id] >= 20 then
if table.find(playerweapons(id),80) then
msg2(id,"©255000000You already own this item!")
else
parse("equip "..id.." 80")
msg2(id,"©000255000You bought Armor!")
ammopack[id] = ammopack[id] - 20
end
else
msg2(id,"©255000000You don't have enough ammopack!")
end
elseif button == 6 then
if ammopack[id] >= 30 then
if table.find(playerweapons(id),81) then
msg2(id,"©255000000You already own this item!")
else
parse("equip "..id.." 81")
msg2(id,"©000255000You bought Heavy Armor!")
ammopack[id] = ammopack[id] - 30
end
else
msg2(id,"©255000000You don't have enough ammopack!")
end
elseif button == 7 then
if ammopack[id] >= 30 then
if table.find(playerweapons(id),91) then
msg2(id,"©255000000You already own this item!")
else
parse("equip "..id.." 91")
msg2(id,"©000255000You bought FnF2000!")
ammopack[id] = ammopack[id] - 30
end
else
msg2(id,"©255000000You don't have enough ammopack!")
end
elseif button == 8 then
if ammopack[id] >= 15 then
if table.find(playerweapons(id),31) then
msg2(id,"©255000000You already own this item!")
else
parse("equip "..id.." 31")
msg2(id,"©000255000You bought SG-552!")
ammopack[id] = ammopack[id] - 15
end
else
msg2(id,"©255000000You don't have enough ammopack!")
end
end
end
end
addhook("serveraction","_serveraction")
function serveraction(id,action)
if action == 1 then
if player(id,"team")==1 then
menu(id,"Zombie Shop,Chainsaw| 20,Gas Grenade| 10,Molotov| 10")
end
end
end
addhook("menu","menuuus")
function menuuus(id,title,button)
if title == "Zombie Shop" then
if button == 1 then
if ammopack[id] >= 20 then
if table.find(playerweapons(id),85) then
msg2(id,"©255000000You already own this item!")
else
parse("equip "..id.." 85")
msg2(id,"©000255000You bought Chainsaw!")
ammopack[id] = ammopack[id] - 20
end
else
msg2(id,"©255000000You don't have enough ammopack!")
end
elseif button == 2 then
if ammopack[id] >= 10 then
if table.find(playerweapons(id),72) then
msg2(id,"©255000000You already own this item!")
else
parse("equip "..id.." 72")
msg2(id,"©000255000You bought Gas Grenade!")
ammopack[id] = ammopack[id] - 10
end
else
msg2(id,"©255000000You don't have enough ammopack!")
end
elseif button == 3 then
if ammopack[id] >= 10 then
if table.find(playerweapons(id),73) then
msg2(id,"©255000000You already own this item!")
else
parse("equip "..id.." 73")
msg2(id,"©000255000You bought Molotov!")
ammopack[id] = ammopack[id] - 10
end
else
msg2(id,"©255000000You don't have enough ammopack!")
end
end
end
end
Help when i'm go to CT and ZOMBIE TEAM i'm ope nshop and buy it not owrk it not doing any thing ... help me
I'm Have no error msg