isCar = {[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,
}
function prawojazdy ( thePlayer, seat, jacked )
if (not isCar[getElementModel(source)]) then return end
local playeraccount = getPlayerAccount ( thePlayer )
if seat == 0 then
if not getAccountData(playeraccount, "prawojazdy") then
outputChatBox ( "Nie posiadasz prawa jazdy kategorii B lub zosta?o ono cofni?te!", thePlayer, 255, 255, 255, true )
cancelEvent ()
end
end
end
Spos?b na accountDate i tabel? z pojazdami jest o tyle lepszy, ?e zamiast w acl.xml zapisuje si? w bazie danych kont i mo?esz wyznaczy?, do jakich aut nie mo?esz wsiada? kiedy nie masz prawka
[ Dodano: 2015-11-26, 19:47 ]
Co do drugiego problemu to:
function zamknijgui ()
guiSetVisible(okno,false)
showCursor (false, true)
end
addEventHandler("onClientGUIClick",zamknij,zamknijgui)
function prawojazdy ( thePlayer, seat, jacked )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Prawko" ) ) then
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if seat == 0 then
if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Prawko" ) ) then
outputChatBox ( "Nie posiadasz prawa jazdy kategorii B lub zosta?o ono cofni?te!", thePlayer, 0, 255, 0, true )
cancelEvent ()
end
end
end
end
addEventHandler('onVehicleStartEnter',root,prawojazdy)
[ Dodano: 2015-11-26, 20:11 ]
db accName a nil value
[ Dodano: 2015-11-26, 20:11 ]
a i to drugie tez nie dziala na te gui
function prawojazdy ( thePlayer, seat, jacked )
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Prawko" ) ) then
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if seat == 0 then
if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Prawko" ) ) then
outputChatBox ( "Nie posiadasz prawa jazdy kategorii B lub zosta?o ono cofni?te!", thePlayer, 0, 255, 0, true )
cancelEvent ()
end
end
end
end
addEventHandler('onVehicleStartEnter',root,prawojazdy)
function prawojazdy ( thePlayer, seat, jacked )
if (not isCar[getElementModel(source)]) then return end
local playeraccount = getPlayerAccount ( thePlayer )
if seat == 0 then
if not isObjectInACLGroup ("user."..accName, aclGetGroup ( "Prawko" ) ) then
outputChatBox ( "Nie posiadasz prawa jazdy kategorii B lub zosta?o ono cofni?te!", thePlayer, 255, 255, 255, true )
cancelEvent ()
end
end
end
[lua]function zamknijgui ()
if source ~= zamknij then return end
guiSetVisible(okno,false)
showCursor (false, true)
end
addEventHandler("onClientGUIClick",getRootElement (),zamknijgui)
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