Witam serdecznie. Mam wielki problem. Pr?bowa?em sam si? z nim upora?, ale moja wiedza jest zbyt ma?a . Chodzi o to, ?e w pracy autobus, gdy jaki? gracz na serwerze wejdzie do autobusu ka?demu wy?wietli si? info na czacie "Zacz??e? prace kierowcy autobusu (...)" A gdy kilka os?b wejdzie do autobusu, to jeden b?dzie m?g? "kra??" przystanki drugiemu. Jak zrobi? ?eby praca by?a tak jakby dla jednego gracza. Tutaj kod:
luki123luki123, nie b?d? nachalny i nie pro? si? o piwa i reputacje, bo to ?wiadczy o braku kultury.
Mo?esz zrobi? tak?e sposobem moim, czyli po tworzeniu markera nadaje mu setElementDate z nickiem gracza intergowanego. Nast?pnie p?tla na markery i if bla == nick gracza to tworzy funckj? kolejn?.
luki123luki123, po pierwsze mnie nie by?o, wi?c nie mog?em ci da? piwa i repu. I czy m?g?by? mi to wsadzi? w m?j kod? By?bym wdzi?czny, otrzymasz 5 piw
local rootElement = getRootElement()
local busses = {[437] = true}
local Duraklar = {
[1]={-2000.1877441406, 195.46136474609, 27.5390625},
[2]={-1996.1949462891, 338.1559753418, 34.458801269531},
[3]={-1819.6047363281, 371.0954284668, 16.494701385498},
[4]={-1658.0651855469, 386.40524291992, 6.4748606681824},
[5]={-1553.6131591797, 661.59149169922, 6.4819502830505},
[6]={-1530.9566650391, 964.94720458984, 6.4844288825989},
[7]={-1635.7996826172, 1257.1275634766, 6.4874968528748},
[8]={-1988.2543945313, 1314.4470214844, 6.4815640449524},
[9]={-2326.4782714844, 1374.0675048828, 6.4832334518433},
[10]={-2625.263671875, 1314.5977783203, 6.485456943512},
[11]={-2826.7387695313, 876.99084472656, 43.349967956543},
[12]={-2844.07421875, 511.33483886719, 4.1004056930542},
[13]={-2812.3327636719, 205.65841674805, 6.4744448661804},
[14]={-2748.7412109375, -213.97444152832, 6.4776849746704},
[15]={-2452.6572265625, -213.55686950684, 32.926258087158},
[16]={-2396.435546875, -73.812614440918, 34.608352661133},
[17]={-2237.5100097656, -73.677185058594, 34.61568069458},
[18]={-2033.1370849609, -73.505355834961, 34.616176605225},
[19]={-2002.8745117188, 94.33309173584, 26.984334945679},
[20]={-1988.1975097656, 165.10362243652, 26.983469009399},
}
function yeniDurak(thePlayer, ID)
local x, y, z = Duraklar[ID][1], Duraklar[ID][2], Duraklar[ID][3]
triggerClientEvent(thePlayer,"otobus_durak_loc",thePlayer,x,y,z)
end
function onVehicleEnter(thePlayer)
if not busses[getElementModel(source)] then return end
outputChatBox ("Zacz??e? prace kierowcy autobusu. Na ka?dym przystanku zatrzymaj si? na 8sek. Pami?taj, aby nie opuszcza? pojazdu.")
local x, y, z = yeniDurak(thePlayer, 1)
setElementData(thePlayer,"Data",1)
end
addEventHandler("onVehicleEnter",rootElement,onVehicleEnter)
addEvent("gorev_bitir",true)
addEventHandler("gorev_bitir",rootElement,
function (client)
if not isPedInVehicle(client) then return end
if not busses[getElementModel(getPedOccupiedVehicle(client))] then return end
local driver == getVehicleOccupant ( getPedOccupiedVehicle(client), 0 )
if driver then
givePlayerMoney(client, 3)
if #Duraklar == tonumber(getElementData(client,"Data")) then
setElementData(client,"Data",1)
else
setElementData(client,"Data",tonumber(getElementData(client,"Data"))+1)
end
yeniDurak(client, tonumber(getElementData(client,"Data")))
end
end)
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