Wysłany: 2018-07-08, 00:08
koko7864
PSEUDO SKRYPTER
Wiek: 22 Na forum: 3230 dni Posty: 41
Nick w MP: Mar0x
Piwa : 1
Witam mam problem ze zrobieniem RH Paczka PYS 3.0
Nie mam poj?cia jak zrobi? Rh
wy?le kilka kod?w
1 MONTOWANIEMK
addEvent ( "rh" , true )
addEventHandler ( "rh" , root , function()
pojazd = getPedOccupiedVehicle ( source )
if not pojazd then return end
if ( getPlayerMoney ( source ) > tonumber ( rh )) then
local id = getElementData ( pojazd , "vehicle:id" )
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_vehicles SET rh=1 WHERE id=?" , id )
outputChatBox ( "* Pomy?lnie zaprogramowano RH1." , source , true )
outputChatBox ( "* Oddaj auto do przecho aby zobaczy? efekty!" , source , true )
takePlayerMoney ( source , rh )
else
outputChatBox ( "* Nie sta? Ci? na to." , source , true )
end
end
)
Community-rh1
]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 outputChatBox ( "* Osi?gn??e?(a?) limit regulacji zawieszenia !" , getVehicleController ( c ), 255 , 255 , 255 ) cancelEvent () return end
setVehicleHandling ( c , "suspensionForceLevel" , tonumber ( s ) - 0.24 )
setElementData ( c , "rh:up" , gora + 1 )
outputChatBox ( "* Auto zosta?o obni?one." , getVehicleController ( c ), 255 , 255 , 255 , true )
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 outputChatBox ( "* Osi?gn??e?(a?) limit regulacji zawieszenia !" , getVehicleController ( c ), 255 , 255 , 255 ) cancelEvent () return end
setVehicleHandling ( c , "suspensionForceLevel" , tonumber ( s ) + 0.24 )
setElementData ( c , "rh:up" , gora - 1 )
outputChatBox ( "* Auto zosta?o podwy?szone." , getVehicleController ( c ), 255 , 255 , 255 , true )
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 ( car , "vehicle:id" ), "1" )
if #qr == 1 then
triggerClientEvent ( source , "rhshow" , root )
end
end
end )
Pystories-vehciles
local mk1 = vehicle [ 'mk1' ]
local mk1 = vehicle [ 'mk2' ]
local naped = vehicle [ 'awd' ]
local rh = vehicle [ 'rhshow' ]
TAM JESZCZE CO ? PO ? RODKU JEST NAPISANE ALE TO CHYBA NIE POTRZEBNE
addEventHandler ( "onVehicleEnter" , getRootElement (), function( plr , seat , jacked )
if seat ~= 0 then return end
if getElementData ( source , "vehicle:id" ) and getElementData ( source , "vehicle:spawn" ) then
local mk2 = exports [ 'pystories-db' ]: dbGet ( "SELECT * FROM pystories_vehicles WHERE id=? AND mk2=?" , getElementData ( source , "vehicle:id" ), "1" )
local mk1 = exports [ 'pystories-db' ]: dbGet ( "SELECT * FROM pystories_vehicles WHERE id=? AND mk1=?" , getElementData ( source , "vehicle:id" ), "1" )
local naped = exports [ 'pystories-db' ]: dbGet ( "SELECT * FROM pystories_vehicles WHERE id=? AND naped=?" , getElementData ( source , "vehicle:id" ), "1" )
local np = exports [ 'pystories-db' ]: dbGet ( "SELECT * FROM pystories_vehicles WHERE id=? AND naped=?" , getElementData ( source , "vehicle:id" ), "1" )
local rh = exports [ 'pystories-db' ]: dbGet ( "SELECT * FROM pystories_vehicles WHERE id=? AND rh=?" , getElementData ( source , "vehicle:id" ), "1" )
if #mk1 > 0 then outputChatBox(" Pomy?lnie zaprogramowano MK1",plr,255,255,255) end
if #mk2 > 0 then outputChatBox(" Pomy?lnie zaprogramowano MK2",plr,255,255,255) end
if #naped > 0 then outputChatBox(" Pomy?lnie zaprogramowano Nap?d 4x4",plr,255,255,255) end
if #rh > 0 then outputChatBox(" Pomy?lnie Gwintowe zawieszenie",plr,255,255,255) end
end
end )
Wysłany: 2018-07-11, 09:50
Hades.
Łiiiiiiiiii
Wiek: 22 Na forum: 4699 dni Posty: 372
Nick w MP: Hades
Piwa : 3214
W czym tu tkwi problem??
[ Dodano : 2018-07-11, 09:55 ]
Z tego co wiem to w PYS jest chyba od tego jaki? system montowania tego je?li nie ma to ?ap komende dla admin?w:
addCommandHandler ( "rh" , function( plr , cmd )
if not getElementData ( plr , "player:logged" ) then return end
local adm = getElementData ( plr , "player:admin" )
if not adm then return end
local veh = getPedOccupiedVehicle ( plr )
if not veh then return end
if ( getPlayerMoney ( plr ) > tonumber ( rh )) then
local id = getElementData ( veh , "vehicle:id" )
exports [ "pystories-db" ]: dbSet ( "UPDATE pystories_vehicles SET rh=1 WHERE id=?" , id )
outputChatBox ( "* Pomy?lnie zaprogramowano RH1." , plr , 255 , 255 , 255 , true )
outputChatBox ( "* Oddaj auto do przecho aby zobaczy? efekty!" , plr , 255 , 255 , 255 , true )
else
outputChatBox ( "* Nie sta? Ci? na to." , plr , 255 , 255 , 255 , true )
end
end )
[ Dodano : 2018-07-11, 09:55 ]
Wystarczy wej?? do pojazdu zalogowany jako admin, i wpisa? /rh
Tagi: gwintowe :: zawieszenie
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: