Krzemo1234
Wiek: 26 Na forum: 3751 dni Posty: 387
Nick w MP: Krzemo
Piwa : 16
Witam mam rh podpi?te ?adnie wszystko i nie wiem czemu nie dzia?a podpi?te pod pystories
Server
function getVehicleHandlingProperty ( element , property )
if isElement ( element ) and getElementType ( element ) == "vehicle" and type ( property ) == "string" then
local handlingTable = getVehicleHandling ( element )
local value = handlingTable [ property ]
if value then
return value
end
end
return false
end
function o ( c )
if c then
local gora = getElementData ( c , "rh:up" ) or 0
local s = getVehicleHandlingProperty ( c , "suspensionForceLevel" )
if tonumber ( gora ) == 4 then exports [ "1" ]: outputNotificationBox ( getVehicleController ( c ), "#cc0000Osi?gn??e? limit regulacji zawieszenia!" ) cancelEvent () return end
setVehicleHandling ( c , "suspensionForceLevel" , tonumber ( s ) - 0.16 )
setElementData ( c , "rh:up" , gora + 1 )
exports [ "1" ]: outputNotificationBox ( getVehicleController ( c ), "#00ccccAuto zosta?o obni?one!" )
end
end
addEvent ( "rh:o" , true )
addEventHandler ( "rh:o" , root , o )
function p ( c )
if c then
local gora = getElementData ( c , "rh:up" ) or 0
local s = getVehicleHandlingProperty ( c , "suspensionForceLevel" )
if tonumber ( gora ) == - 8 then exports [ "1" ]: outputNotificationBox ( getVehicleController ( c ), "#cc0000Osi?gn??e? limit regulacji zawieszenia!" ) cancelEvent () return end
setVehicleHandling ( c , "suspensionForceLevel" , tonumber ( s ) + 0.19 )
setElementData ( c , "rh:up" , gora - 1 )
exports [ "1" ]: outputNotificationBox ( getVehicleController ( c ), "#00ccccAuto zosta?o podwy?szone!" )
end
end
addEvent ( "rh:p" , true )
addEventHandler ( "rh:p" , root , p )
addEventHandler ( "onPlayerVehicleEnter" , root ,
function( car , seat )
if seat ~= 0 then return end
if getElementData ( car , "vehicle:id" ) and getElementData ( source , "player:uid" ) then
local qr = exports [ 'pystories-db' ]: dbGet ( "SELECT * FROM pystories_vehicles WHERE id=? AND rh=?" , getElementData ( source , "vehicle:id" ), "1" )
if #qr == 1 then
triggerClientEvent ( source , "rhshow" , root )
end
end
end )
Client
addEventHandler ( "onClientResourceStart" , resourceRoot ,
function()
rh = guiCreateWindow ( 11 , 209 , 166 , 174 , "REGULACJA ZAWIESZENIA" , false )
guiWindowSetSizable ( rh , false )
guiWindowSetMovable ( rh , true )
gora = guiCreateButton ( 9 , 23 , 147 , 74 , "Podwy?sz" , false , rh )
dol = guiCreateButton ( 9 , 103 , 147 , 61 , "Obni?" , false , rh )
guiSetVisible ( rh , false )
end
)
addEventHandler ( "onClientGUIClick" , resourceRoot , function( btn )
local veh = getPedOccupiedVehicle ( localPlayer )
if source == gora then
triggerServerEvent ( "rh:p" , root , veh )
elseif source == dol then
triggerServerEvent ( "rh:o" , root , veh )
end
end )
function patch ()
local veh = getPedOccupiedVehicle ( localPlayer )
if not veh then
if rh and ( guiGetVisible ( rh ) == true ) then
guiSetVisible ( rh , false )
end
end
end
addEventHandler ( "onClientRender" , root , patch )
function show ()
guiSetVisible ( rh , true )
end
addEvent ( "rhshow" , true )
addEventHandler ( "rhshow" , root , show )
fileDelete ( "c.lua" )
Dodam ,?e nie ma ?adnych b??d?w w DB3 nie mam poj?cia co si? dzieje za pomoc piwo