| Tematy otagowane jako: klatka |
| 1. klatka |
[lua]
function getPointFromDistanceRotation(x,y,dist,angle)
local a=math.rad(90-angle);
local dx=math.cos(a) * dist;
local dy=math.sin(a) * dist;
return x+dx, y+dy;
end
addCommandHandler("ustawklatke", function(plr)
if getElementData(plr, "user:duty") then
local x,y,z=getElementPosition(plr)
local dim=getElementDimension(plr)
local int=getElementInterior(plr)
local kratki=createObject(971, x,y,z-0.9, 270, 0, 180)
setElementData(kratki,"owner",getPlayerName(plr))
setElementDimension(kratki,dim)
setElementInterior(kratki,int)
local kratki=createObject(971, x,y,z+6, 270, 0, 180)
setElementData(kratki,"owner",getPlayerName(plr))
setElementDimension(kratki,dim)
setElementInterior(kratki,int)
local kratki=createObject(971, x,y+3.5,z+2.5, 0, 0, 0)
setElementData(kratki,"owner",getPlayerName(plr))
setElementDimension(kratki,dim)
setElementInterior(kratki,int)
local kratki=createObject(971, x-4.5,y,z+2.5, 0, 0, 270)
setElementData(kratki,"owner",getPlayerName(plr))
setElementDimension(kratki,dim)
setElementInterior(kratki,int)
local kratki=createObject(971, x,y-3.5,z+2.5, 0, 0, 180)
setElementData(kratki,"owner",getPlayerName(plr))
setElementDimension(kratki,dim)
setElementInterior(kratki,int)
local kratki=createObject(971, x+4,y,z+2.5, 0, 0, 270)
setElementData(kratki,"owner",getPlayerName(plr))
setEl... |
| 2. Klatka |
Witam mam o to taki kodzik na klatk?:
[lua]klatka = false
addCommandHandler("klatka",
function (player)
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("RCON")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Moderator")) then
if klatka == false then
local x,y,z = getElementPosition(player)
sk = createObject(971, x, y, z + 6, 90, 0, 0)
lxk = createObject(971, x, y+ 4.2, z+2.7, 0, 0, 180)
lzk = createObject(971, x, y- 4.2, z+2.7, 0, 0, 180)
pxk = createObject(971, x+ 4.2, y, z+2.7, 0, 0, 90)
pzk = createObject(971, x- 4.2, y, z+2.7, 0, 0, 90)
klatka = true
else
outputChatBox("Jest ju? stworzona klatka! Aby j? usun?? wpisz /usun.klatka",player)
end
end
addCommandHandler("usun.klatka",
function (player)
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("RCON")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Admin")) or isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("Moderator")) then
if klatka == true then
destroyElement(sk)
destroyElement(lxk)
destroyElement(lzk)
d... |
| 3. Klatka Nie działa |
Witam Mam taki oto problem z klatka gdy? na serwerze takim co jest po zainstalowaniu "MTA SA" dzia?a natomiast na serwerze hostingowanym nie dzia?a daje kod moze da sie to jakos rozwiazac:
[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) ... |
| 4. Klatka |
| xxxx |
|