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

Wysłany: 2015-11-26, 19:36


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Witam robie prawo jazdy i mam problem z wchodzeniem do auta gdy gracz nie ma prawka

db3 nie ma

function prawkoniemasz playerseatjacked )
       local accName getAccountName getPlayerAccount player ) )
    if isObjectInACLGroup ("user."..accNameaclGetGroup 'Prawko' ) ) then    
        if seat == 0 then
        else
            cancelEvent()
            outputChatBox('Nie posiadasz prawa jazdy, musisz je zdac w urzedzie.',player,0,255,0)
        end
    end
end
addEventHandler('onVehicleStartEnter',getRootElement(),prawkoniemasz)


Moge wsiadac jak nie jestem w grupie acl :( za pomoc :piwo:

a i mam drugi problem z zamykaniem gui poprzez button ;(

CLIENT
function zamknijgui ()
guiSetVisible(okno,false)
triggerServerEvent("guiokno",root)
end
addEventHandler("onClientGUIClick",zamknij,zamknijgui)


server:
addEventHandler('guiokno',root,function(player)
showCursor(player,false)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 19:44


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Spr?buj wykona? co? t? metod?:

 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 thePlayerseatjacked )
        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!"thePlayer255255255true )
                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 (falsetrue)
end
addEventHandler("onClientGUIClick",zamknij,zamknijgui)


Strona clienta jakby? nie wiedzia? ;)

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 19:49


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

dalem to do kodu i nie dziala ;(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 19:53


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Bo z tym pierwszym to ci da?em przyk?ad, zmie? to sobie na sprawdzanie acl :)

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 20:10


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

mam takie cos i nie dziala ;P


function prawojazdy thePlayerseatjacked )
        if  isObjectInACLGroup ("user."..accNameaclGetGroup "Prawko" ) ) then
    local accName getAccountName getPlayerAccount thePlayer ) )
    if seat == 0 then
            if not isObjectInACLGroup ("user."..accNameaclGetGroup "Prawko" ) ) then
            outputChatBox "Nie posiadasz prawa jazdy kategorii B lub zosta?o ono cofni?te!"thePlayer02550true )
                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 ;P

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 20:15


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%

function prawojazdy thePlayerseatjacked )
 local accName getAccountName getPlayerAccount thePlayer ) )
        if  isObjectInACLGroup ("user."..accNameaclGetGroup "Prawko" ) ) then
    local accName getAccountName getPlayerAccount thePlayer ) )
    if seat == 0 then
            if not isObjectInACLGroup ("user."..accNameaclGetGroup "Prawko" ) ) then
            outputChatBox "Nie posiadasz prawa jazdy kategorii B lub zosta?o ono cofni?te!"thePlayer02550true )
                cancelEvent ()
end
end
end
end
addEventHandler('onVehicleStartEnter',root,prawojazdy)


Z gui co ci nie dzia?a?

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 20:17


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

To samo co wtedy ze arg 2 got nil ;(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 20:18


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Wywal to getAccountData spod isObjectInACLGroup..

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 20:33


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Wywalilem mam tera takie cos i nic :


 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 thePlayerseatjacked )
 local accName getAccountName getPlayerAccount thePlayer ) )
        if  isObjectInACLGroup ("user."..accNameaclGetGroup "Prawko" ) ) then
    if seat == 0 then
            if not isObjectInACLGroup ("user."..accNameaclGetGroup "Prawko" ) ) then
            outputChatBox "Nie posiadasz prawa jazdy kategorii B lub zosta?o ono cofni?te!"thePlayer02550true )
                cancelEvent ()
end
end
end
end
addEventHandler('onVehicleStartEnter',root,prawojazdy)


DB 3: http://www.wrzucajtu.pl/w...26_20-31-14.png

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 20:37


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
function prawojazdy thePlayerseatjacked )
        if (not isCar[getElementModel(source)]) then return end
    local playeraccount getPlayerAccount thePlayer )
    if seat == 0 then
            if not   isObjectInACLGroup ("user."..accNameaclGetGroup "Prawko" ) )  then
            outputChatBox "Nie posiadasz prawa jazdy kategorii B lub zosta?o ono cofni?te!"thePlayer255255255true )
                cancelEvent ()
end
end
end


Boj? si? o twoj? przysz?o?? :eye:

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 20:47


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4329 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

To jak macie pomysly ??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-11-26, 20:52


jg2aviva1

Rusek :D






Wiek: 25
Na forum: 4134 dni
Posty: 445
Nick w MP: _Wolfenstei[N]^.^

Piwa: 1033

Respekt: 240
Respekt: 240Respekt: 240

Ostrzeżeń: 60%
Testuj okienko:

[lua]function zamknijgui ()
if source ~= zamknij then return end
guiSetVisible(okno,false)
showCursor (false, true)
end
addEventHandler("onClientGUIClick",getRootElement (),zamknijgui)

Podpis



GTAO Member: 2015-08-23, 14:26

Postaw piwo autorowi tego posta
 

 
Tagi: onvehicleenter
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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