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

Wysłany: 2017-01-29, 14:09


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

zrobi?em taki skrypt na licencje lotnicze i nie dzia?a podpowie kto? co jest ?le ?

serwer

--lista pojazdow 
local blokady = {} 

--kategoria L1
blokady[593] = "L1" -- dodo 
 

--kategoria L2
blokady[520] = "L2" -- hydra 
blokady[577] = "L2" -- AT
blokady[512] = "L2" -- cropduster
blokady[553] = "L2" -- Nevada
blokady[476] = "L2" -- Rustler
blokady[519] = "L2" -- Shamal
blokady[460] = "L2" -- Skimmer
blokady[513] = "L2" -- Stunplane


--markery 

local biurkop createMarker358.77,186.47,1007.38"cylinder"20,0255,255setElementInterior(biurkop3setElementDimension(biurkop3) 

function onPrawkoHit(hitElementdim) 
if getElementType(hitElement) == "player" then 
triggerClientEvent(hitElement"showGUILot"resourceRootfalsefalsefalseend 
end 
addEventHandler("onMarkerHit"biurkoponPrawkoHit) 
--// koniec markerow i ich funkcji 
local veh = {} 

addEvent("egzaminPrawaLot"trueaddEventHandler("egzaminPrawaLot"getRootElement(), 
function(kategoriacenalocal account getPlayerAccount(source) 
if account then 
local data getAccountData(account"kat"..kategoria) 
if not data or data == false or data == nil then 
if not veh[sourcethen 
if kategoria == "L1" then 
veh[source] = createVehicle(593,324.99,2541.45,17.2000,-180setElementDimension(source0setElementInterior(source0setElementData(veh[source], "vopis""Egzamin prawa Lotniczego kategori 'L1'"setElementData(veh[source], "pojazdy_paliwo"50) 
if kategoria == "L2" then 
veh[source] = createVehicle(520,324.99,2541.45,17.2000,-90setElementDimension(source0)
setElementInterior(source0)  
setElementData(veh[source], "vopis""Egzamin prawa Lotniczego kategori 'L2'"setElementData(veh[source], "pojazdy_paliwo"50)
if kategoria == "H1" then 
veh[source] = createVehicle(520,324.99,2541.45,17.2000,-90setElementDimension(source0)
setElementInterior(source0)  
setElementData(veh[source], "vopis""Egzamin prawa Lotniczego kategori 'H1'"setElementData(veh[source], "pojazdy_paliwo"50) 
elseif kategoria == "H2" then 
veh[source] = createVehicle(520,324.99,2541.45,17.2000,-90setElementDimension(source0setElementInterior(source0setElementData(veh[source], "vopis""Egzamin prawa Lotniczego kategori 'H2'"setElementData(veh[source], "pojazdy_paliwo"50end 
takePlayerMoney(sourcecenasetElementInterior(source0warpPedIntoVehicle (sourceveh[source]) 
triggerClientEvent(source"startEgzamin"resourceRootveh[source]) 
outputChatBox("Rozpocz??e? egzamin na prawo Lotniczego (kategoria "..kategoria..")."source230230230truesetElementData(source"egzamin"kategoria) 
else 
outputChatBox("Rozpocz??e? ju? jeden egzamin."source230230230trueend 
else 
outputChatBox("Posiadasz ju? prawo Lotnicze na kategori? "..kategoria.."."source230230230trueend 
end 
end
end
end)

addEvent("egzaminZdany"trueaddEventHandler("egzaminZdany"getRootElement(), 
function() 
if isElement(veh[source]) then 
destroyElement(veh[source]) 
end 

local kat getElementData(source"egzamin"local account getPlayerAccount(source) 
if account then 
setAccountData(account"kat"..kattrueoutputChatBox("Gratulacje! Zda?e? prawo Lotnicze na kategori? "..kat.."!"source230230230truesetElementData(source"egzamin"falsewarpToSzkolaJazdy(sourceend 
endaddEvent("egzaminOblany"trueaddEventHandler("egzaminOblany"getRootElement(), 
function() 
if isElement(veh[source]) then 
destroyElement(veh[source]) 
end 

local kat getElementData(source"egzamin"local account getPlayerAccount(source) 
if account then 
setAccountData(account"kat"..katfalseoutputChatBox("Niestety, nie uda?o Ci si? zda? prawa Lotniczego na kategorie "..kat.."!"source230230230true)
setElementData(source"egzamin"falsewarpToSzkolaJazdy(sourceend 
end) 

function warpToSzkolaJazdy(playerremovePedFromVehicle (playerveh[player] = false 
setElementInterior(player3setElementDimension(player3setElementPosition(player367.19,182.55,1008.38setElementRotation(player000end 

--blokada wchodzenia 

function onBlokadaVeh(playerseatjackedlocal id getElementModel(sourcelocal blokada blokady[id] 
if blokada then 
if (seat == 0then 
local account getPlayerAccount(player) 
if account then 
local kategoria getAccountData(account"kat"..blokada) 
if kategoria ~= true then 
cancelEvent() 
outputChatBox ("Potrzebujesz prawa Lotniczego kategorii "..blokada.." by prowadzi? ten pojazd."player230230230trueend 
end 
end 
end 
end 
addEventHandler ("onVehicleStartEnter"getRootElement(), onBlokadaVeh



strona clienta

--kolejne wspolrzedne punktow 
local trasa = { 
{326.33,2522.63,-23.0},
{421.72,2522.38,-23.0},
{407.40,2500.01,-23.0},
{271.71,2503.65,-18.88},
{-23.05,2513.72,61.70},
{-266.89,2572.74,99.48},
{-606.13,2673.00,114.89},
{-921.04,2710.44,114.89},
{-1251.28,2669.80,114.89},
{-1429.81,2486.61,114.89},
{-1366.73,2183.62,114.89},
{-1230.87,1883.49,114.89},
{-951.19,1708.86,114.89},
{-495.42,1675.43,114.89},
{-126.05,1717.60,114.89},
{225.69,1889.74,114.89},
{551.05,2032.26,114.89},
{726.86,2119.09,114.89},
{930.95,2223.35,108.26},
{1038.98,2371.99,92.44},
{765.81,2473.53,67.05},
{509.34,2494.50,49.85},
{391.92,2503.73,-18.0},
{311.32,2505.43,-23.0},
{290.47,2544.32,-23.0},
}--{xyz}, prosze pamietac o przecinkudziekuje 

--nasze kategorie oraz ceny 
local kategorie = { 
{"L1"700}, 
{"L2"1500}, 
{"H1"500},
{"H2"1000},
} 

--gui 
mojeW,mojeH 640480 
sW,sH guiGetScreenSize() 
widthheight = (sW/mojeW), (sH/mojeHlocal guiLot = {} 
guiLot[1] = guiCreateWindow(150*width65*height321*width309*height"Prawo Lotnicze"falseguiWindowSetSizable(guiLot[1], falseguiLot[2] = guiCreateLabel(61*width62*height204*width37*height"Zdawanie prawa Lotniczego\n Na serwerze San Andreas Life"falseguiLot[1]) 
guiLabelSetHorizontalAlign(guiLot[2], "left"trueguiLot[3] = guiCreateGridList(45*width113*height236*width132*heightfalseguiLot[1]) 
guiLot[4] = guiGridListAddColumn(guiLot[3], "Kategoria"0.5guiLot[5] = guiGridListAddColumn(guiLot[3], "Koszt (PLN)"0.5local row guiGridListAddRow (guiLot[3]) 
guiGridListSetItemText (guiLot[3], rowguiLot[4], "Kategoria L1"falsefalseguiGridListSetItemText (guiLot[3], rowguiLot[5], kategorie[1][2], falsefalselocal row guiGridListAddRow (guiLot[3]) 
guiGridListSetItemText (guiLot[3], rowguiLot[4], "Kategoria L2"falsefalseguiGridListSetItemText (guiLot[3], rowguiLot[5], kategorie[2][2], falsefalselocal row guiGridListAddRow (guiLot[3])
guiGridListSetItemText (guiLot[3], rowguiLot[4], "Kategoria H1"falsefalseguiGridListSetItemText (guiLot[3], rowguiLot[5], kategorie[3][2], falsefalselocal row guiGridListAddRow (guiLot[3]) 
guiGridListSetItemText (guiLot[3], rowguiLot[4], "Kategoria H2"falsefalseguiGridListSetItemText (guiLot[3], rowguiLot[5], kategorie[4][2], falsefalselocal row guiGridListAddRow (guiLot[3])  

guiLot[6] = guiCreateButton(10*width255*height122*width44*height"Anuluj"falseguiLot[1]) 
guiLot[7] = guiCreateButton(190*width255*height121*width44*height"Dalej"falseguiLot[1]) 
guiSetVisible(guiLot[1], falseaddEvent("showGUILot"trueaddEventHandler("showGUILot"getRootElement(), 
function(abcdeguiSetVisible(guiLot[1], trueshowCursor(trueend) 

function onPrawkoZamknij() 
guiSetVisible(guiLot[1], falseshowCursor(falseend 
addEventHandler ("onClientGUIClick"guiLot[6], onPrawkoZamknijfalse) 

function onPrawkoDalej() 
local rowcolumn guiGridListGetSelectedItem(guiLot[3]) 
if row ~= -1 then 
local text guiGridListGetItemText (guiLot[3], rowguiLot[4]) 
local cena guiGridListGetItemText (guiLot[3], rowguiLot[5]) 
if tonumber(cena) <= getPlayerMoney(localPlayerthen 
if text == "Kategoria L1" then 
triggerServerEvent("egzaminPrawaLot"localPlayer"L1"cena) 
if text == "Kategoria L2" then 
triggerServerEvent("egzaminPrawaLot"localPlayer"L2"cena)
if text == "Kategoria H1" then 
triggerServerEvent("egzaminPrawaLot"localPlayer"H1"cena) 
elseif text == "Kategoria H2" then 
triggerServerEvent("egzaminPrawaLot"localPlayer"H2"cena)  
end 
else 
outputChatBox("Nie posiadasz wystarczaj?co pieni?dzy."230230230trueend 
end 
end 
end
end
addEventHandler ("onClientGUIClick"guiLot[7], onPrawkoDalejfalse) 

--egzamin 
addEvent("startEgzamin"trueaddEventHandler("startEgzamin"getRootElement(), 
function(vehonPrawkoZamknij() 

SAVEVEH veh --zapisuje sobie moj pojazd 
checkpoint 1 
stworzNowyCheckpoint() 

addEventHandler("onClientVehicleExit"resourceRoot, function(playerseat) 
if seat == 0 then 
triggerServerEvent("egzaminOblany"localPlayerusunOstatniCheckpoint() 
checkpoint false 
SAVEVEH false 
end 
end) 


--4. sek po respie auta mozna dopiero oblac dla bezpieczenstwa przy respawnie 
setTimer(function() 
fixVehicle(SAVEVEHaddEventHandler("onClientVehicleCollision"SAVEVEHonVehicleCollisionend40001end) 

function stworzNowyCheckpoint(source) 
if isElement(punktthen 
removeEventHandler("onClientMarkerHit"punktonCheckpointHitdestroyElement(punktdestroyElement(blipend 

punkt createMarker (trasa[checkpoint][1], trasa[checkpoint][2], trasa[checkpoint][3] + 40"ring"400255,255)
blip createBlip(trasa[checkpoint][1], trasa[checkpoint][2], trasa[checkpoint][3], trasa[checkpoint][4], trasa[checkpoint][5], 412255255255255255350addEventHandler("onClientMarkerHit"punktonCheckpointHitend 

function usunOstatniCheckpoint() 
if isElement(punktthen 
removeEventHandler("onClientMarkerHit"punktonCheckpointHitdestroyElement(punktdestroyElement(blipend 
end 

function onCheckpointHit(hitElement) 
if localPlayer == hitElement then 
checkpoint checkpoint if checkpoint #trasa then 
triggerServerEvent("egzaminZdany"localPlayerzakonczEgzamin() 
else 
stworzNowyCheckpoint() 
end 
end 
end 

function onVehicleCollision(elementloss) 
if loss 50 then 
triggerServerEvent("egzaminOblany"localPlayerzakonczEgzamin() 
end 
end 

function zakonczEgzamin() 
removeEventHandler("onClientVehicleCollision"SAVEVEHonVehicleCollisionusunOstatniCheckpoint() 
checkpoint false 
SAVEVEH false 
end 


za pomoc leci piwko i respekt

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-29, 14:22


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

polaczkos, Podaj b??d z db3

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-29, 14:38


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

W?anie nie ma ?adnego b??du

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-29, 14:53


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

polaczkos, Wi?c napisz w kt?rym momencie kod przestaje dzia?a? lub dzia?a tak jak nie powinien.

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-30, 17:50


polaczkos







Wiek: 25
Na forum: 4085 dni
Posty: 168
Nick w MP: polaczkos

Piwa: 3

Respekt: 45,3

jak chcem rozpocz?? dan? licencje nic sie nie dzieje i nie wiem czemu to nie dzia?a

Postaw piwo autorowi tego posta
 

 
Tagi: licencje :: lotnicze
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » licencje lotnicze 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