Wysłany: 2014-11-24, 14:00
wwa22442
Wiek: 38 Na forum: 4706 dni Posty: 127
Piwa : 82
Witam.
Jak zrobi? w tym kodzie tak, aby gracz kt?ry wsiada do pojazdu o id : 411 nie musia? posiada? prawa jazdy ?
kod :
function prawojazdy ( thePlayer , seat , jacked )
local playeraccount = getPlayerAccount ( thePlayer )
if seat == 0 then
if not getAccountData ( playeraccount , "prawojazdy" ) then
outputChatBox ( "Nie posiadasz prawa jazdy!" , thePlayer , 255 , 255 , 255 , true )
cancelEvent ()
end
end
end
addEventHandler ( "onVehicleStartEnter" , getRootElement (), prawojazdy )
Pozdrawiam
Wysłany: 2014-11-24, 14:52
Blur
Wiek: 28 Na forum: 4298 dni Posty: 47
Nick w MP: Blu
Piwa : 2
Dodaj warunek sprawdzaj?cy czy dane auto ma id r?wne 411.
Uzyj do tego tej funkcji:
Wysłany: 2014-11-24, 15:04
wwa22442
Wiek: 38 Na forum: 4706 dni Posty: 127
Piwa : 82
function prawojazdy ( thePlayer , seat , jacked )
local playeraccount = getPlayerAccount ( thePlayer )
if seat == 0 then
if not getAccountData ( playeraccount , "prawojazdy" ) then
outputChatBox ( "Nie posiadasz prawa jazdy!" , thePlayer , 255 , 255 , 255 , true )
cancelEvent ()
local id = getElementModel ( theVehicle ) -- get the model ID of the vehicle
if id == 400 then
local vehicleName = getVehicleName ( theVehicle )
outputChatBox ( "Tym pojazdem mozesz jezdzic. " .. vehicleName .. "!" )
end
end
end
end
addEventHandler ( "onVehicleStartEnter" , getRootElement (), prawojazdy )
Tak ?
Wysłany: 2014-11-27, 14:14
Tostuch
Wiek: 27 Na forum: 4931 dni Posty: 483
Nick w MP: Tost
Piwa : 137
addEventHandler ( "onVehicleStartEnter" , getRootElement (), function( plr , seat )
if seat == 0 and getElementModel ( source ) ~= 411 then
if not getAccountData ( getPlayerAccount ( plr , "prawojazdy" )) then
cancelEvent ()
outputChatBox ( "Nie mo?esz prowadzi? pojazd?w bez prawa jazdy!" , plr )
else
end
end
end )
Pisane z g?owy, nie testowane.
Tagi: prawo :: jazdy :: pojazdu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: