Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: klatki
1. Usuwanie klatki
Klatka dzia?a, ale gdy chce usun?? j? usuwa si?, ale wyst?puje b??d z destroyElement. Stawiam piwka.

[lua]-- Copyright by Fanta @2014. Zachowaj autora !

local kratki={}
klatka = {}
local komenda = "klatka" -- komenda bez '/'

addCommandHandler(komenda, function(plr, cmd, target)
local accName = getAccountName ( getPlayerAccount ( plr ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then
if not target then
outputChatBox("Uzyj: /klatka <nick gracza>")
return
end

local cel=getPlayerFromName(target)
if not cel then
outputChatBox("Nie ma takiego gracza.")
return
end

local x,y,z=getElementPosition(cel)
local dim=getElementDimension(cel)
local int=getElementInterior(cel)

if kratki[cel] then
for i=1, #kratki[cel] do -- najoptymalniejsza petla
if isElement(kratki[cel][i]) then
destroyElement(kratki[cel][i])
end
end
kratki[cel]=nil
end

kratki[cel]={}
kratki[cel][1]=createObject(971, x, y, z-0.9, 270, 0, 180.0) -- O.K. Nie rusza?
kratki[cel][2]=createObject(971, x, y, z+6, 270, 0, 180) -- O.K Nie rusza?
kratki[cel][3]=createObject(971, x, y+3.5, z+2.5, 0, 0, 0) -- O.K. Nie rusza?
kratki[cel][4]=createObject(971, x-4.5, y, z+2.5, 0, 0, 270) -- O.K. Nie rusza?
kratki[cel][5]=createObject(971, x, y-3.5, z+2.5, 0, 0, 180) -- O.K. Nie rusza?
kratki[cel][6]=createObject(971, x+4, y, z+2.5, 0, 0, 270) -- O.K. Nie rusza?
...