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]
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
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.