Wysłany: 2013-01-18, 20:40
pidbulxd
Wiek: 28 Na forum: 5230 dni Posty: 135
Nick w MP: Word
Piwa : 540
Witam !
Stworzy?em skrypt, na zablokowanie aut firm. Czy mog? prosi? was o ma?? pomoc ?
Mianowicie, stworzy?em o taki kod:
local burrita = {
{ 2485 , - 1667.1875 , 14.1796875 - 1 }
}
function start ()
for k , v in ipairs ( burrita ) do
local veh1 = createVehicle ( 482 , v [ 1 ], v [ 2 ], v [ 3 ] )
setElementData ( veh1 , "petrol" , true )
end
end
addEventHandler ( "onResourceStart" , getRootElement (), start )
function autapetrol ( thePlayer )
local vehicle = getPedOccupiedVehicle ( thePlayer )
if getElementData ( vehicle , "petrol" ) == true then
if not ObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "Petrol" ) ) then
outputChatBox ( "Nie jeste? pracownikiem PetrolPol Sp.z.o.o" , thePlayer , 255 , 255 , 255 )
cancelEvent ()
end
end
end
addEventHandler ( "onVehicleStartEnter" , getRootElement (), autapetrol )
Problem polega na tym ?e, nie wiem jak u?y? setVehicleLocked, aby zamyka?o drzwi auta stworzone w funkcji 'start'. Mog? prosi? o nakierowanie mnie na dobry tor ?
edit. 19.1.2013r.
Ostatnio zmieniony przez pidbulxd 2013-01-19, 12:52, w całości zmieniany 1 raz
Wysłany: 2013-01-18, 21:11
Abross
Wiek: 31 Na forum: 4983 dni Posty: 2
Nick w MP: Abross
policeVehicles = { [ 594 ]= true ,[ 594 ]= true ,[ 594 ]= true ,[ 594 ]= true ,[ 594 ]= true ,[ 594 ]= true ,[ 594 ]= true }
policeSkins = { [ 280 ]= true ,[ 281 ]= true ,[ 282 ]= true ,[ 283 ]= true ,[ 284 ]= true ,[ 285 ]= true ,[ 286 ]= true }
function enterVehicle ( player , seat , jacked )
if ( seat == 0 ) then
if ( policeVehicles [ getElementModel ( source )] ) and ( not policeSkins [ getElementModel ( player )] ) then
cancelEvent ()
outputChatBox ( "Ten pojazd nale?y do Policji." , player , 255 , 255 , 0 , true )
end
end
end
addEventHandler ( "onVehicleStartEnter" , getRootElement (), enterVehicle )
Wysłany: 2013-01-18, 21:15
pidbulxd
Wiek: 28 Na forum: 5230 dni Posty: 135
Nick w MP: Word
Piwa : 540
Abross , to mi nie potrzebne. To co dales wyzej, blokuje WSZYSTKIE POJAZDY. Ja chce zablokowac tylko te, ktore utworzylem tabel? wielowymiarowa
Wysłany: 2013-01-20, 10:41
Oski
LUA Scripter
Wiek: 30 Na forum: 5246 dni Posty: 428
Nick w MP: Oski
Piwa : 56
Jak ju? ci t?umaczy?em na gg.
Kod:
function start()
for k, v in ipairs ( burrita ) do
local veh1 = createVehicle ( 482, v[1], v[2], v[3] )
setElementData(veh1, "petrol", true)
setVehicleLocked(veh1,true)
end
end
addEventHandler("onResourceStart", getRootElement(), start)
Tagi: auta :: firm
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: