STOPseba
Emeryt na scenie MTA
Wiek: 25 Na forum: 3771 dni Posty: 448
Nick w MP: STOPseba
Piwa : 5014
Witam od pewnego czasu staram si? przerobi? skrypt na przecho i cos mi nie wychodzi mianowicie chodzi o to ?eby by?o przecho w sf/ls/lv.
Daje wam czysty skrypt poniewa? jak edytowa?em to tak namiesza?em ze...
S:
local mdestroy = createMarker (- 1944.58 , 617.24 , 35.02 - 1 , "cylinder" , 5 , 50 , 255 , 250 , 50 )
createBlipAttachedTo ( mdestroy , 35 )
local t = createElement ( "text" )
setElementData ( t , "scale" , 1.5 )
setElementData ( t , "name" , "Pozostawianie pojazd?w" )
setElementPosition ( t ,- 1944.58 , 617.24 , 35.02 )
addEvent ( "onParkingGetRekords" , true )
addEventHandler ( "onParkingGetRekords" , root , function()
local uid = getElementData ( source , "player:uid" )
if not uid then return end
local result = exports [ "ogrpg-db" ]: dbGet ( "SELECT * FROM ogrpg_vehicles WHERE ownedPlayer=? AND parking=1" , uid )
if #result > 0 then
triggerClientEvent ( source , "onParkingGetVehicles" , source , result )
end
end )
addEventHandler ( "onMarkerHit" , mdestroy , function( el , md )
if getElementType ( el ) == "player" then
local veh = getPedOccupiedVehicle ( el )
if not veh then return end
if getVehicleController ( veh ) ~= el then return end
local id = getElementData ( veh , "vehicle:id" )
if not id then return end
if isTimer ( timeroddania ) then return end
setElementFrozen ( veh , true )
outputChatBox ( "* Trwa zapisywanie pojazdu." , el , 255 , 255 , 255 , true )
toggleControl ( el , "enter_exit" , false )
timeroddania = setTimer (function()
exports [ "AQL-vehicles" ]: onSaveVehicle ( veh )
destroyElement ( veh )
exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET parking=1 WHERE id=?" , id )
toggleControl ( el , "enter_exit" , true )
outputChatBox ( "* Pomy?lnie zapisano pojazd." , el , 255 , 255 , 255 , true )
end , 3000 , 1 )
end
end )
addEvent ( "onParkingVehicleSpawn" , true )
addEventHandler ( "onParkingVehicleSpawn" , root , function( id )
if not id then return end
local spawn = exports [ "AQL-vehicles" ]: onRespawnVehicles ( _ , id ,{- 1959.84 , 616.75 , 34.67 , 360.0 , 0.1 , 182.5 })
if spawn then
outputChatBox ( "* Zrespiono pojazd." , source )
end
end )
C:
local marker = createMarker (- 1952.77 , 618.46 , 35.02 - 1 , "cylinder" , 2 , 0 , 128 , 250 )
local sphere = createColSphere (- 1960.27 , 617.56 , 34.70 , 6 )
local t = createElement ( "text" )
setElementData ( t , "scale" , 1.5 )
setElementData ( t , "name" , "Odbi?r pojazd?w" )
setElementPosition ( t ,- 1952.77 , 618.46 , 35.02 )
local wm ={}
wm . window = guiCreateWindow ( 0.25 , 0.26 , 0.51 , 0.42 , "Odbieranie pojazd?w" , true )
guiWindowSetSizable ( wm . window , false )
guiWindowSetMovable ( wm . window , false )
guiSetVisible ( wm . window , false )
wm . gridlist = guiCreateGridList ( 0.04 , 0.09 , 0.92 , 0.65 , true , wm . window )
guiGridListAddColumn ( wm . gridlist , "ID" , 0.4 )
guiGridListAddColumn ( wm . gridlist , "Model" , 0.6 )
wm . submit = guiCreateButton ( 0.04 , 0.76 , 0.47 , 0.19 , "Wyjmij pojazd" , true , wm . window )
wm . close = guiCreateButton ( 0.57 , 0.75 , 0.39 , 0.20 , "Zamknij" , true , wm . window )
addEvent ( "onParkingGetVehicles" , true )
addEventHandler ( "onParkingGetVehicles" , root , function( result )
guiGridListClear ( wm . gridlist )
if not result then return end
for i , v in pairs ( result ) do
local row = guiGridListAddRow ( wm . gridlist )
guiGridListSetItemText ( wm . gridlist , row , 1 , v [ "id" ], false , false )
guiGridListSetItemText ( wm . gridlist , row , 2 , getVehicleNameFromModel ( v [ "model" ]), false , false )
end
end )
addEventHandler ( "onClientMarkerHit" , marker , function( el , md )
if el ~= localPlayer then return end
if isPedInVehicle ( el ) then return end
if guiGetVisible ( wm . window ) == false then
showCursor ( true )
guiSetVisible ( wm . window , true )
triggerServerEvent ( "onParkingGetRekords" , localPlayer )
-- setCameraMatrix ( 1600.59 ,- 1425.06 , 13.47 , 1600.59 ,- 1425.06 , 13.47 )
end
end )
addEventHandler ( "onClientGUIClick" , resourceRoot , function()
if source == wm . close then
if guiGetVisible ( wm . window ) == true then
showCursor ( false )
guiSetVisible ( wm . window , false )
setCameraTarget ( localPlayer , localPlayer )
end
end
if source == wm . submit then
local selectedRow = guiGridListGetSelectedItem ( wm . gridlist ) or - 1
if selectedRow < 0 then return end
local vehicles = getElementsWithinColShape ( sphere , "vehicle" )
if #vehicles > 0 then
outputChatBox ( "* Nie ma miejsca aby wyci?gn?? pojazd." , 255 , 0 , 0 )
return
end
local id = guiGridListGetItemText ( wm . gridlist , selectedRow , 1 )
guiGridListRemoveRow ( wm . gridlist , selectedRow )
triggerServerEvent ( "onParkingVehicleSpawn" , localPlayer , tonumber ( id ))
end
end )
function render1 ()
dxDrawText ( " Nie ma miejsca aby wyci?gn?? pojazd" , screenW * 0.3656 , screenH * 0.1553 , screenW * 0.6273 , screenH * 0.3193 , tocolor ( 255 , 0 , 0 , 255 ), 1.50 , "pricedown" , "center" , "center" , false , false , false , false , false )
end
function renderstop1 ()
removeEventHandler ( "onClientRender" , root , render1 )
end
Moze kto? mnie nakierowa? jak takie co? zrobi? za pomoc zimny prosto z lod?wki