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: cuboidzie
1. coś nie tak w cuboidzie
Siema, robi? kod na parking wirtualny dla frakcji i zrobi?em colCuboid w miejscu gdzie beda auta sie respic i w db wywala jeden b??d:

Kod:

client:
[lua]
local cuboid = createColCuboid(-1577.53, 704.05, -6.24, 8.04, 4.35, 3.26)

addEventHandler("onClientClick", root, function(btn, state)
if btn == "left" and state == "down" then
if isMouseInPosition(screenW * 0.5891, screenH * 0.6593, screenW * 0.1130, screenH * 0.0500) then
if guiGetVisible(lista) == true then
local selectedRow=guiGridListGetSelectedItem(lista) or -1
if selectedRow < 0 then return end
local vehicles=getElementsWithinColShape(cuboid,"vehicle")
if isElementWithinColShape(vehicles, cuboid) then
outputChatBox("Miejsce spawnu jest zaj?te, spr?buj po?niej!")
return
end
local id=guiGridListGetItemText(lista, selectedRow, 6)
guiGridListRemoveRow(lista, selectedRow)
draw_on=false
guiSetVisible(lista,false)
showCursor(false, false)
triggerServerEvent("spawnuj", localPlayer, tonumber(id))
toggleControl("fire", true)
end
end
end
end)
[/lua]

server:
[lua]
addEvent("spawnuj", true)
addEventHandler("spawnuj", root, function(id)
if not id then return end
local spawn=createVehicle(id, -1573.09424, 705.59589, -5.64320, 0,0,90, "SAPD_")
if spawn then
outputChatBox("Done!", el)
end
end)
[/lua]

B??d w db: [img]https://i.imgur.com/ReCe1...
2. Śmierć w cuboidzie
Siemka
Wie kto? z was jak zrobi? aby kto? kto zginie w danym cuboidzie pojawia? si? w podanym w kodzie miejscu?
Z G?ry Dzi?ki za pomoc
3. Ostatni w cuboidzie
Siemka mam pewien problem
Poniewa? robie pewien skrypt na event serwerowy i chce aby ostatnia osoba ktora zostanie w cuboidzie dosta?a np 5k
Niestety nie wiem jak zrobic to aby to dostawala hajs ta osoba ktora zostaje w nim a innych juz nie ma
4. Limit pojazdów w cuboidzie
Siemka, mam problem ze skryptem gdy? powinien on teleportowa? czwarty pojazd kt?ry wje?d?a do cuboidu gdzie powinny by? w cuboidzie maksymalnie trzy auta ale nie dzia?a.
Dlatego zwracam si? do was.

M?j niedzia?aj?cy skrypt:

function amountvehicle element )
    
local vehicleamount getElementsByType "vehicle" )
        if 
isElementWithinColShape(elementcuboidthen
            
if vehicleamount 3 then
                setElementPosition 
element1777.8, -1815.313.5 )
                
outputChatBox("Osi?gni?to maksimum pojazd?w!"element)
            
end
        end
    end
end
addEventHandler
("onColShapeHit"cuboidamountvehicle)