Witam chce aby w Pracy trzeba by?o mie? prawo jazdy Kat. L
I Moge normalnie wchodzic do samolotu jak nie mam Licencji
//Tylko w pracy aby dzia?a?o to (Nie chce aby by?o trzeba mie? prawko Og?lnie)
Oto kod
Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
[ Dodano: 2017-02-14, 12:39 ]
Jeszcze cos
Jak zdam prawko na Drona To jak wjade w ostatni Punkt To nic sie nie dzeje
local marker2=createMarker(-2050.29,-106.16,35.24,"corona",2,170,200,0)
addEventHandler("onMarkerHit", marker2, function(el,md)
setElementPosition(el,-2044.69,-94.57,35.17 )
end)
addEvent("license:do",true)
addEventHandler("license:do", resourceRoot, function(cost,selected)
if tonumber(cost) <= getPlayerMoney(client) then
takePlayerMoney(client,cost)
end
local veh=nil
if selected == "A" then veh=createVehicle(586, 160.04, -168.15, 1.24, 359.5, 360.0, 87.3)
elseif selected == "B" then veh=createVehicle(436,160.04, -168.15, 1.24, 359.5, 360.0, 87.3 )
elseif selected == "C" then veh=createVehicle(482, 160.04, -168.15, 1.24, 359.5, 360.0, 87.3)
elseif selected == "Dron" then veh=createVehicle(511, 428.86, 2495.59, 17.10, 3.1, 359.8, 80.3) end
if not veh then return end
if selected == "Dron" then
setElementData(veh,"vehicle:desc","Egzamin Licencji Lotniczej\nKategoria "..selected)
else
setElementData(veh,"vehicle:desc","Egzamin prawa jazdy\nKategoria "..selected)
end
setElementData(veh,"vehicle:mileage",16442)
setElementData(veh,"vehicle:fuel",100)
setElementData(veh,"vehicle:lic",true)
setElementDimension(client,0)
setElementInterior(client,0)
warpPedIntoVehicle(client,veh)
triggerClientEvent(client, "license:start", resourceRoot, selected, veh)
outputChatBox("", root, 255, 0, 0)
end)
addEvent("license:vehdel", true)
addEventHandler("license:vehdel", resourceRoot, function(veh)
destroyElement(veh)
end)
addEventHandler("onPlayerQuit", root, function()
local veh=getPedOccupiedVehicle(source)
if not veh then return end
if getVehicleController(veh) ~= source then return end
if not getElementData(veh,"vehicle:lic") then return end
destroyElement(veh)
end)
addEventHandler("onVehicleDamage", resourceRoot, function(loss)
local kierowca=getVehicleController(source)
if not kierowca then return end
if not getElementData(source,"vehicle:lic") then return end
destroyElement(source)
outputChatBox("* Uszkodzi?e?(a?) pojazd, nie zdajesz egzaminu! :c", kierowca, 255, 0, 0)
triggerClientEvent(kierowca, "license:finish", resourceRoot, true)
end)
addEventHandler("onVehicleStartExit", resourceRoot, function()
cancelEvent()
end)
[ Dodano: 2017-02-14, 12:40 ]
function finishLicense(value)
if isElement(licenseMarker) and licenseMarker then
destroyElement(licenseMarker)
licenseMarker=nil
end
if isElement(licenseBlip) and licenseBlip then
destroyElement(licenseBlip)
licenseBlip=nil
end
if value == true then
licenseCategory=nil
licenseVehicle=nil
licenseMarker=nil
licenseTarget=nil
licenseBlip=nil
end
end
addEvent("license:finish",true)
addEventHandler("license:finish", resourceRoot, finishLicense)
function showMarker()
local pos=categoryPositions[licenseCategory][licenseTarget]
if licenseCategory ~= "Dron" then
licenseMarker=createMarker(pos[1], pos[2], pos[3], "checkpoint", 1, 0, 0, 255, 155)
else
licenseMarker=createMarker(pos[1], pos[2], pos[3], "ring", 3, 0, 0, 255, 155)
end
licenseBlip=createBlip(pos[1], pos[2], pos[3], 0, 1, 255, 0, 0)
if categoryPositions[licenseCategory][licenseTarget+1] then
e=categoryPositions[licenseCategory][licenseTarget+1]
setMarkerTarget(licenseMarker, e[1], e[2], e[3])
end
addEventHandler("onClientMarkerHit", licenseMarker, function(el,md)
if not md or el~=localPlayer then return end
if not getPedOccupiedVehicle(el) then return end
if licenseTarget < #categoryPositions[licenseCategory] then
local sound=playSound(":ogrpg-misc/misc/point.wav")
--setSoundVolume(sound, 1.0)
finishLicense(false)
licenseTarget=licenseTarget+1
showMarker()
else
local sound=playSound(":ogrpg-misc/misc/success.flac")
--setSoundVolume(sound, 1.0)
outputChatBox("* Zda?e?(a?) egzamin. Gratulacje!")
triggerServerEvent("license:vehdel", resourceRoot, licenseVehicle)
setElementData(localPlayer,"player:license:pj"..licenseCategory, 1)
finishLicense(true)
end
end)
end
Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
mixLoLmix2, Panie Programisto Lua proponowa?bym usun?? ten podpisik bo tylko si? pogr??asz - Co do problemu, masz tabele 'categoryPositions' ? Ponadto ten warunek
if licenseTarget < #categoryPositions[licenseCategory] then
jest dziwny. Je?li licenseTarget jest mniejsze ni? tabela wtedy cos tam... Ojj ci Programi?ci tacy zapominalscy a przecie? dla nich takie rzeczy to b?achostki powinny by?...
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