_Haze
Peace Yo!
Wiek: 24 Na forum: 4184 dni Posty: 1648
Nick w MP: Haze
Piwa : 2628
Hubio69 ,
mina ={}
czas ={}
minuty = 5 -- czas po kt ? rych mo ? esz rozstawia ? dalej miny
addCommandHandler ( "mina" ,function( plr , cmd )
if czas [ plr ] and czas [ plr ] ~= 0 then
if czas [ plr ] == 5 then outputChatBox ( "Musisz odczeka? " .. minuty .. " po wystawieniu 5min" , plr , 255 , 255 , 255 ) return end
czas [ plr ] = czas [ plr ] + 1
local x , y , z = getElementPosition ( plr )
setPedAnimation ( plr , "BOMBER" , "BOM_Plant" )
setTimer ( setPedAnimation , 1500 , 1 , plr , false )
local x , y , z = getElementPosition ( plr )
setTimer (function()
ob = createObject ( 1953 , x , y , z - 1 )
mina [ plr ]= createMarker ( x , y , z - 1 , "cylinder" , 2 , 255 , 255 , 255 , 0 )
setElementData ( mina [ plr ], "mina" , getPlayerName ( plr ))
attachElements ( ob , mina [ plr ])
end , 1500 , 1 )
outputChatBox ( "*Rozstawi?e?(a?) min? nr " .. czas [ plr ].. ", uwa?aj na ni?!" , plr , 255 , 255 , 255 )
else
czas [ plr ] = 1
local x , y , z = getElementPosition ( plr )
setPedAnimation ( plr , "BOMBER" , "BOM_Plant" )
setTimer ( setPedAnimation , 1500 , 1 , plr , false )
local x , y , z = getElementPosition ( plr )
setTimer (function()
ob = createObject ( 1953 , x , y , z - 1 )
mina [ plr ]= createMarker ( x , y , z - 1 , "cylinder" , 2 , 255 , 255 , 255 , 0 )
setElementData ( mina [ plr ], "mina" , getPlayerName ( plr ))
attachElements ( ob , mina [ plr ])
end , 1500 , 1 )
setTimer (function()
czas [ plr ] = {}
end , minuty * 60 * 1000 , 1 )
outputChatBox ( "*Rozstawi?e?(a?) pierwsz? min?, uwa?aj na ni?!" , plr , 255 , 255 , 255 )
end
end )
addEventHandler ( "onMarkerHit" , root ,function( e )
if getElementData ( source , "mina" ) then
if getElementType ( e )== "player" then
if getElementData ( source , "mina" )== getPlayerName ( e ) then return end
local x , y , z = getElementPosition ( e )
createExplosion ( x , y , z , 3 )
if getPlayerFromName ( getElementData ( source , "mina" )) then
outputChatBox ( "*Gracz " .. getPlayerName ( e ).. " wszed? na Twoj? min?!" , getPlayerFromName ( getElementData ( source , "mina" )), 255 , 255 , 255 )
end
for _ , v in ipairs ( getAttachedElements ( source ))do
destroyElement ( v )
end
destroyElement ( source )
end
end
end )
Ostatnio zmieniony przez _Haze 2017-01-08, 14:10, w całości zmieniany 1 raz