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

Wysłany: 2016-02-16, 20:42


EseJax







Wiek: 31
Na forum: 4085 dni
Posty: 67
Nick w MP: Toffy.

Piwa: 982

Respekt: 55,3

Ostrzeżeń: 100%
No i jestem znowu, wcze?niej mia?em problem z nadawaniem prawka, teraz mam problem z jego sprawdzaniem..

Kod:
katA = {[461]=true, [462]=true, [463]=true, [468]=true, [521]=true, [522]=true,[523]=true, [581]=true, [586]=true
}
katC = {[403]=true, [406]=true, [413]=true, [414]=true, [416]=true, [423]=true,[428]=true, [431]=true, [433]=true, [437]=true, [440]=true, [455]=true,[456]=true, [459]=true, [482]=true, [498]=true, [499]=true, [508]=true, [514]=true, [515]=true, [524]=true, [538]=true, [573]=true
}
katB = {[401]=true, [402]=true, [410]=true, [411]=true, [412]=true, [415]=true, [419]=true, [422]=true, [423]=true, [424]=true,
 [429]=true, [434]=true, [436]=true, [439]=true, [444]=true, [451]=true, [467]=true, [474]=true, [475]=true, [477]=true, [478]=true, [480]=true, 
 [489]=true, [491]=true, [494]=true, [495]=true, [496]=true, [500]=true, [502]=true, [503]=true, [504]=true, [505]=true, [506]=true, [508]=true, 
 [517]=true, [518]=true, [525]=true, [526]=true, [527]=true, [533]=true, [534]=true, [535]=true, [536]=true, [541]=true, [542]=true, [543]=true, 
 [545]=true, [549]=true, [552]=true, [554]=true, [555]=true, [558]=true, [559]=true, [562]=true, [565]=true, [568]=true, [574]=true, [575]=true, 
 [576]=true, [587]=true, [589]=true, [600]=true, [602]=true, [603]=true, [400]=true, [404]=true, [405]=true, [409]=true, [413]=true, [418]=true, [420]=true, [421]=true, [426]=true, [428]=true, [431]=true, [438]=true, [440]=true, [442]=true, 
 [445]=true, [458]=true, [459]=true, [466]=true, [467]=true, [470]=true, [479]=true, [482]=true, [483]=true, [492]=true, [507]=true, [516]=true, [529]=true, [540]=true, [546]=true, [547]=true, 
 [550]=true, [551]=true, [560]=true, [561]=true, [566]=true, [567]=true, [579]=true, [580]=true,
}
katL = {[592]=true, [553]=true, [577]=true, [488]=true, [511]=true, [497]=true, [548]=true, [563]=true, [512]=true, [476]=true, [593]=true, [447]=true, [425]=true, [519]=true, [520]=true, [460]=true, [417]=true, [469]=true, [487]=true, [513]=true
}


function prawojazdy(plrseat)
    local uid=getElementData(plr,"player:uid")
    if seat == 0 then
    if (not katC[getElementModel(source)]) then return end
    local result=exports["og-db"]:getRekord("SELECT * FROM og_vehicles WHERE pjC=1"id)
    if result then return end
    outputChatBox "Nie posiadasz prawa jazdy kategorii C b?d? zosta?o ono cofni?te!"plr255255255true )
    cancelEvent ()
end
end
addEventHandler "onVehicleStartEnter"getRootElement(), prawojazdy )

function prawojazdy2(plrseat)
    if seat == 0 then
    if (not katB[getElementModel(source)]) then return end
    local result=exports["og-db"]:getRekord("SELECT * FROM og_vehicles WHERE pjB=1"id)
    if result then return end
    outputChatBox "Nie posiadasz prawa jazdy kategorii B b?d? zosta?o ono cofni?te!"plr255255255true )
    cancelEvent ()
end
end
addEventHandler "onVehicleStartEnter"getRootElement(), prawojazdy2 )

function prawojazdy3(plrseat)
    if seat == 0 then
    if (not katA[getElementModel(source)]) then return end
    local result=exports["og-db"]:getRekord("SELECT * FROM og_vehicles WHERE pjA=1"id)
    if result then return end
    outputChatBox "Nie posiadasz prawa jazdy kategorii A b?d? zosta?o ono cofni?te!"plr255255255true )
    cancelEvent ()
end
end
addEventHandler "onVehicleStartEnter"getRootElement(), prawojazdy3 )

function prawojazdy4(plrseat)
    if seat == 0 then
    if (not katB[getElementModel(source)]) then return end
    local result=exports["og-db"]:getRekord("SELECT * FROM og_vehicles WHERE pjL=1"id)
    if result then return end
    outputChatBox "Nie posiadasz prawa jazdy kategorii B b?d? zosta?o ono cofni?te!"plr255255255true )
    cancelEvent ()
end
end
addEventHandler "onVehicleStartEnter"getRootElement(), prawojazdy4 )

Licz? na pomoc ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-16, 23:25


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

hmm dam Ci podpowiedz :

"local = result=exports"

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Tagi: mysql :: sprawdzanie :: prawka
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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