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

Wysłany: 2020-02-29, 09:08


Bartixowy







Wiek: 32
Na forum: 3027 dni
Posty: 21
Nick w MP: Bartixowy



Respekt: 60

Cze??. Mam problem ot?? nie wiem jak stworzy? auto po stronie serwera tak aby skrypt clienta widzia? skrypty serwera .
client:
<lua>
marker = createMarker(-1838.72, -78.93, 15.11-1, "cylinder", 1, 0, 0, 0, 95)

addEventHandler("onClientMarkerHit", resourceRoot, function(hitElement, dimension)
if getElementType(hitElement) == "player" then
if isElement(source) and source == marker then
marker2 = createMarker(-1712.25, 389.30, 7.18-1, "cylinder", 3, 255, 0, 0, 95, hitElement)
blip2 = createBlip(-1712.25, 389.30, 7.18, 12, hitElement)
elseif isElement(source) and source == marker2 then
destroyElement(marker2)
destroyElement(blip2)
outputChatBox("Trwa za?adunek paliwa", localPlayer)
marker3 = createMarker(-2460.39, 786.61, 35.17-1,"cylinder", 3,255,0,0,95,hitElement)
blip3 = createBlip(-2460.39, 786.61, 35.17, 12, hitElement)
elseif isElement(source) and source == marker3 then
outputChatBox("Pozosta?o 2 punkty", localPlayer)
destroyElement(marker3)
destroyElement(blip3)
marker4 = createMarker(-2689.96, 233.43, 4.34-1,"cylinder",3,255,0,0,95, hitElement)
blip4 = createBlip(-2689.96, 233.43, 4.34, 12, hitElement)
elseif isElement(source) and source == marker4 then
outputChatBox("Pozosta? ostatni punkt", localPlayer)
destroyElement(marker4)
destroyElement(blip4)
marker5 = createMarker(-2413.58, 330.54, 34.98-1,"cylinder",3,255,0,0,95,hitElement)
blip5 = createBlip(-2413.58, 330.54, 34.98, 12,hitElement)
elseif isElement(source) and source == marker5 then
destroyElement(marker5)
destroyElement(blip5)
setElementPosition(hitElement)
destroyElement(dodo)
end
end
end)
</lua>
A serwera nie wiem jak napisa?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-02-29, 16:09


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-02-29, 20:46


Maniekxx

Amator






Wiek: 24
Na forum: 2894 dni
Posty: 232
Nick w MP: Maniekxx

Piwa: 225

Respekt: 110
Respekt: 110

Ostrzeżeń: 20%
client:


marker createMarker(-1838.72, -78.9315.11-1"cylinder"100095)

addEventHandler("onClientMarkerHit"resourceRoot, function(hitElementdimension)
    if getElementType(hitElement) == "player" then
        if isElement(source) and source == marker then
            marker2 createMarker(-1712.25389.307.18-1"cylinder"32550095hitElement)
            blip2 createBlip(-1712.25389.307.1812hitElement)
            triggerServerEvent("create:veh"hitElement) -- Tworzy pojazd po stronie serwera.
        elseif isElement(source) and source == marker2 then
            destroyElement(marker2)
            destroyElement(blip2)
            outputChatBox("Trwa za?adunek paliwa"localPlayer)
            marker3 createMarker(-2460.39786.6135.17-1,"cylinder"3,255,0,0,95,hitElement)
            blip3 createBlip(-2460.39786.6135.1712hitElement)
        elseif isElement(source) and source == marker3 then
            outputChatBox("Pozosta?o 2 punkty"localPlayer)
            destroyElement(marker3)
            destroyElement(blip3)
            marker4 createMarker(-2689.96233.434.34-1,"cylinder",3,255,0,0,95hitElement)
            blip4 createBlip(-2689.96233.434.3412hitElement)
        elseif isElement(source) and source == marker4 then
            outputChatBox("Pozosta? ostatni punkt"localPlayer)
            destroyElement(marker4)
            destroyElement(blip4)
            marker5 createMarker(-2413.58330.5434.98-1,"cylinder",3,255,0,0,95,hitElement)
            blip5 createBlip(-2413.58330.5434.9812,hitElement)
        elseif isElement(source) and source == marker5 then
            destroyElement(marker5)
            destroyElement(blip5)
            setElementPosition(hitElement)
            destroyElement(dodo)
        end
    end
end)


serwer:


addEvent("create:veh"true)
addEventHandler("create:veh"root, function()
    --pojazd[client] = createVehicle(id pojazdupozycja pojazdu.)
    pojazd[client] = createVehicle(482, -1976.69106.2727.81359.1360.090.4) -- Przyk?adowa pozycja.
    setVehiclePlateText(pojazd[client], "San Fierro")
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-01, 10:40


Bartixowy







Wiek: 32
Na forum: 3027 dni
Posty: 21
Nick w MP: Bartixowy



Respekt: 60

Okej, teoretycznie dzia?a ale przy tworzeniu pojazdu wyskakuje b??d a nil value

Postaw piwo autorowi tego posta
 

 
Wysłany: 2020-03-01, 13:03


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Stw?rz nad eventem tabel? 'pojazd'.

local pojazd = {}


Postaw piwo autorowi tego posta
 

 
Tagi: praca
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » praca Odpowiedz do tematu

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