Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-08-03, 17:46


Rumper

Majster od pysa






Wiek: 15
Na forum: 3316 dni
Posty: 231
Nick w MP: Rumper

Piwa: 592

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 20%
Witam,posiadam taki problem ?e chcia?bym aby po wej?ciu w marker pojawia?o si? gui
niestety pr?bowa?em na r??ne sposoby i mi jako? nie wychodzi.
local b=createElement("text")
setElementData(b,"name","PRACA: Kierowca Street-View\nZAROBEK:\nOD 75PLN-150PLN\nOPIS: Identyfikowanie mapy")
setElementPosition(b,-1990.74957.8845.45)


local zone createColSphere(-1986.58955.0345.54,)
createBlip(-1984.40953.9245.4546,2,0,0,0,0,0,275)
local m1 createMarker(-1990.74957.8845.45-1"cylinder"1.53514235)
vehs = {}
local code "StreetView"
veh_obj = {}

function removePreviousVehicles(plr)
    for i,v in ipairs(getElementsByType("vehicle"resourceRoot)) do
        local sby getElementData(v"zrespilGracz")
        if sby and sby == plr and getPedOccupiedVehicle(plr) ~= v then
            destroyElement(v)
        end
    end
end

addEventHandler("onClientRender"root,
    function siema()
        dxDrawRectangle(38770524405tocolor(483435255), false)
    end
)

addEventHandler("onMarkerHit"m1, function(elmd)  
    if getElementData(el"vehicle_job_owner2"then
        outputChatBox("Wyst?pi? b??d #6969, zg?o? si? do CEO!"el)
        return
    end

    if not md or getElementType(el) ~= "player" or getPedOccupiedVehicle(elthen return end
    if getElementData(el,"player:job"then return end
    if #getElementsWithinColShape(zone,"vehicle") >= 1 then outputChatBox("*Parking zaj?ty czekaj a? wyjedzie!",el) return end
    local x,y,getElementPosition(el)
    local bus createVehicle(400, -1986.58955.0345.54360.00.0179.3)
    setElementFrozen(el,true)
    setElementData(bus"vehicle_job_owner2"el)
    setElementData(bus"vehicle:fuel"100000)
    setElementData(bus"vehicle:mileage"math.random(50000,80000))
    setVehicleHandling(bus"maxVelocity"80.0)
    setElementData(el,"player:job",code)
   setTimer(warpPedIntoVehicle,200,1,el,bus)
    toggleControl(el,"enter_exit",false)
     setTimer(toggleControl,2000,1,el"enter_exit",true)
    setTimer(setElementFrozen,2000,1,elfalse)
    triggerClientEvent(el"STARTJobBus"resourceRootbus)

    vehs[el] = bus
    veh_obj[bus] = createObject(3031,0,0,0)
    attachElements(veh_obj[bus],bus,0.3,-0.9,1.6,0,0,90)
 end)

addEvent("STOPJobBus"true)
addEventHandler("STOPJobBus"resourceRoot, function()
    local pojazd getPedOccupiedVehicle(client)
    if pojazd then
        destroyElement(pojazd)
    end
end)

addEventHandler("onPlayerVehicleExit",resourceRoot,function()
destroyElement(source)
end)

addEvent("destroyVeh"true)
addEventHandler("destroyVeh"getRootElement(),
function()
     if vehs[clientthen
          if isElement(vehs[client]) then destroyElement(vehs[client]) end
     end
end)

addEventHandler("onElementDestroy",resourceRoot,function()
  if getElementType(source) == "vehicle" then
    if veh_obj[sourcethen destroyElement(veh_obj[source]); veh_obj[source] = nil end
  end
end)

addEvent("onPlayerQuit"true)
addEventHandler "onPlayerQuit"getRootElement(), function()
     if vehs[sourcethen
          if isElement(vehs[source]) then destroyElement(vehs[source]) end
    end
end)

Za pomoc daje :piwo: [/code]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-03, 18:51


maciek3286

LUA Developer






Wiek: 26
Na forum: 5201 dni
Posty: 230
Nick w MP: maciek00

Piwa: 3207

Respekt: 101,5
Respekt: 101,5

Mieszasz eventy. Pokaza?e? kod z c-side czy s-side? Bo na za??czonym kodzie u?ywasz event?w do obu stron.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-03, 19:28


Rumper

Majster od pysa






Wiek: 15
Na forum: 3316 dni
Posty: 231
Nick w MP: Rumper

Piwa: 592

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 20%
s-side

Podpis
Elo benc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-03, 19:44


Kalizman







Wiek: 23
Na forum: 3652 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Lolelo, onClientRender dzia?a tylko po stronie klienta a ty tworzysz po stronie serwera...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-03, 22:11


Adis.exe

LUA Developer






Wiek: 23
Na forum: 3498 dni
Posty: 292
Nick w MP: Adiś.exe

Piwa: 997

Respekt: 110,3
Respekt: 110,3

U?yj onClientRender po c-side


Więcej informacji znajdziesz w Wikipedii MTA:

https://wiki.multitheftauto.com/wiki/OnClientRender


a potem zr?b Eventa i zr?b triggera po sside


Więcej informacji znajdziesz w Wikipedii MTA:

https://wiki.multitheftauto.com/wiki/TriggerClientEvent


Czyli co? takiego mniej wiecej :

--C-SIDE
addEvent("show:gui"true)
addEventHandler("show:gui"root, function()
     addEventHandler("onClientRender"rootjakistamrender)
end)

--S-SIDE
--*tam gdzie chcesz wy?wietliokno*--
triggerClientEvent(thePlayer"show:gui"thePlayer)


Nie wiem czy nie da sie jeszcze czasem na eldatach lub zmiennych typu boolean

Podpis

KONTAKT:
GG: 60968224
Discord: Adiś.exe#3828

Użytkownik: 05.11.2016
GTAO Member: 20.02.2019
Support-Team: 25.07.2018
Support-Team: 19.01.2019
Test Mod: 08.02.2019

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-04, 10:23


Rumper

Majster od pysa






Wiek: 15
Na forum: 3316 dni
Posty: 231
Nick w MP: Rumper

Piwa: 592

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 20%
Nadal nie dzia?a

Podpis
Elo benc
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-04, 10:51


Nexisten

Moderator






Wiek: 22
Na forum: 4108 dni
Posty: 551
Nick w MP: Nexisten

Piwa: 1479

Respekt: 287,3
Respekt: 287,3Respekt: 287,3Respekt: 287,3

To podaj b??dy z DB3, nie mamy magicznej kuli.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-04, 11:52


Rumper

Majster od pysa






Wiek: 15
Na forum: 3316 dni
Posty: 231
Nick w MP: Rumper

Piwa: 592

Respekt: 180
Respekt: 180Respekt: 180

Ostrzeżeń: 20%
WARING: praca/svs.lua:29: Bad argument @ 'triggerClientEvent' [Expected string at argument 1,got nil]

Podpis
Elo benc
Postaw piwo autorowi tego posta
 

 
Tagi: gui
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku