The bomb could have a timer too, and it should cost 2000 and only Ts can have it.
Can someone make it to me, or only upload one at the File Archuive? please, i need it so much (i made a Iraq map and want to it have Human Bombs too). :p
function initArray2(f,v)
local cmd={}
for i=1,f do
cmd[i]=v
end
return cmd
end
carriesbomb=initArray2(32,false)
bombgfx=initArray2(32,0)
addhook("say","saybuy")
function saybuy(id,t)
if (t=="!bomb" and player(id,"team")==1) then
bombgfx[id]=image("yourimagepath",1,0,200+id)
carriesbomb[id]=true
parse("setmoney "..id.." "..(player(id,"money")-2000))
return 1
end
end
addhook("serveraction","explode")
function explode(id,a)
if (a==1 and carriesbomb[id]) then
timer(5000,"parse","explosion "..player(id,"x").." "..player(id,"y").." 96 100 "..id)
msg2(id,"5 seconds until explosion...")
timer(1000,"parse","lua msg2(id,\"4...\")")
timer(2000,"parse","lua msg2(id,\"3...\")")
timer(3000,"parse","lua msg2(id,\"2...\")")
timer(4000,"parse","lua msg2(id,\"1...\")")
timer(5000,"parse","lua carriesbomb["..id.."]=false")
timer(5000,"parse","lua freeimage(bombgfx["..id.."])")
timer(5000,"parse","lua bombgfx["..id.."]=0")
end
end
function initArray2(f,v)
local cmd={}
for i=1,f do
cmd[i]=v
end
return cmd
end
carriesbomb=initArray2(32,false)
bombgfx=initArray2(32,0)
addhook("serveraction","explode")
function explode(id,a)
if (a==1 and carriesbomb[id]) then
msg2(id,"5 seconds until explosion...")
timer(1000,"parse","lua msg2(id,\"4...\")")
timer(2000,"parse","lua msg2(id,\"3...\")")
timer(3000,"parse","lua msg2(id,\"2...\")")
timer(4000,"parse","lua msg2(id,\"1...\")")
timer(5000,"parse","lua carriesbomb["..id.."]=false")
timer(5000,"parse","lua freeimage(bombgfx["..id.."])")
timer(5000,"parse","lua bombgfx["..id.."]=0")
end
if (a==2 and player(id,"team")==1) then
bombgfx[id]=image("yourimagepath",1,0,200+id)
carriesbomb[id]=true
parse("setmoney "..id.." "..(player(id,"money")-2000))
end
end
function initArray2(f,v)
local cmd={}
for i=1,f do
cmd[i]=v
end
return cmd
end
carriesbomb=initArray2(32,false)
bombgfx=initArray2(32,0)
addhook("say","saybuy")
function saybuy(id,t)
if (t=="!bomb" and player(id,"team")==1 and not carriesbomb[id]) then
bombgfx[id]=image("yourimagepath",1,0,200+id)
carriesbomb[id]=true
parse("setmoney "..id.." "..(player(id,"money")-2000))
return 1
end
end
addhook("serveraction","explode")
function explode(id,a)
if (a==1 and carriesbomb[id]) then
timer(5000,"parse","explosion "..player(id,"x").." "..player(id,"y").." 96 100 "..id)
timer(5000,"parse","killplayer "..id)
end
end