STOPseba
Emeryt na scenie MTA
Wiek: 25 Na forum: 3771 dni Posty: 448
Nick w MP: STOPseba
Piwa : 5014
Witam mam problem z przyspieszeniem pojazdu (mk, us) mam tu taki skrypt na monta? tego:
S:
addEvent ( "turbo" , true )
addEventHandler ( "turbo" , root , function()
pojazd = getPedOccupiedVehicle ( source )
local id = getElementData ( pojazd , "vehicle:id" )
if not pojazd then return end
if ( getPlayerMoney ( source ) > tonumber ( 49999 )) then
setElementData ( pojazd , "turbo" , true )
setElementData ( pojazd , "turboy" , true )
query = exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET mk2=1 WHERE id=?" , id )
takePlayerMoney ( source , 50000 )
outputChatBox ( "* Zamontowa?e?(a?) uk?ad Turbo." , source )
setVehicleHandling ( pojazd , "engineAcceleration" , getVehicleHandling ( pojazd ). engineAcceleration + 4 )
setVehicleHandling ( pojazd , "maxVelocity" , getVehicleHandling ( pojazd ). maxVelocity + 35 )
setVehicleHandling ( pojazd , "tractionMultiplier" , 0.8 )
setVehicleHandling ( pojazd , "steeringLock" , 50 )
setVehicleHandling ( pojazd , "driveType" , "awd" )
else
outputChatBox ( "* Nie sta? ci? na Turbo!" , source , true )
end
end
)
S2:
addEvent ( "turboWymontuj" , true )
addEventHandler ( "turboWymontuj" , root , function()
pojazd = getPedOccupiedVehicle ( source )
local id = getElementData ( pojazd , "vehicle:id" )
if not pojazd then return end
givePlayerMoney ( source , 35000 )
setElementData ( pojazd , "turbo" , false )
setElementData ( pojazd , "turboy" , false )
query = exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET mk2=0 WHERE id=?" , id )
outputChatBox ( "* Wymontowa?e?(a?) uk?ad turbo." , source )
setVehicleHandling ( pojazd , "engineAcceleration" , getVehicleHandling ( pojazd ). engineAcceleration - 4 )
setVehicleHandling ( pojazd , "maxVelocity" , getVehicleHandling ( pojazd ). maxVelocity - 35 )
setVehicleHandling ( pojazd , "tractionMultiplier" , 0.5 )
setVehicleHandling ( pojazd , "steeringLock" , 30 )
end )
C:
addEvent ( "turbo" , true )
addEventHandler ( "turbo" , root , function()
pojazd = getPedOccupiedVehicle ( source )
local id = getElementData ( pojazd , "vehicle:id" )
if not pojazd then return end
if ( getPlayerMoney ( source ) > tonumber ( 49999 )) then
setElementData ( pojazd , "turbo" , true )
setElementData ( pojazd , "turboy" , true )
query = exports [ "ogrpg-db" ]: dbSet ( "UPDATE ogrpg_vehicles SET mk2=1 WHERE id=?" , id )
takePlayerMoney ( source , 50000 )
outputChatBox ( "* Zamontowa?e?(a?) uk?ad Turbo." , source )
setVehicleHandling ( pojazd , "engineAcceleration" , getVehicleHandling ( pojazd ). engineAcceleration + 4 )
setVehicleHandling ( pojazd , "maxVelocity" , getVehicleHandling ( pojazd ). maxVelocity + 35 )
setVehicleHandling ( pojazd , "tractionMultiplier" , 0.8 )
setVehicleHandling ( pojazd , "steeringLock" , 50 )
setVehicleHandling ( pojazd , "driveType" , "awd" )
else
outputChatBox ( "* Nie sta? ci? na Turbo!" , source , true )
end
end
)
Problem polega na tym do mysql dodaje mi mk i na serwerze mam przyspieszenie ale jak oddam pojazd do przecho to ju? tego przyspieszenie niema.
tak na marginesie(mo?e tu jest b??d):
s_vehbuy:
addEventHandler ( "onVehicleEnter" , root , function( plr , seat )
local veh = getPedOccupiedVehicle ( plr )
local id = getElementData ( veh , "vehicle:id" )
if getElementData ( veh , "vehTurbo" ) then return end
if getElementData ( source , "turboy" ) and getElementData ( source , "turboy" ) ~= 0 then
outputChatBox ( "* Posiadasz turbo!" , plr )
setElementData ( veh , "vehTurbo" , true )
setVehicleHandling ( veh , "engineAcceleration" , getVehicleHandling ( veh ). engineAcceleration + 4 )
setVehicleHandling ( veh , "maxVelocity" , getVehicleHandling ( veh ). maxVelocity + 35 )
setVehicleHandling ( veh , "tractionMultiplier" , 0.8 )
setVehicleHandling ( veh , "steeringLock" , 50 )
setVehicleHandling ( veh , "driveType" , "awd" )
end
end )
local query = exports [ "ogrpg-db" ]: dbSet ( string . format ( "UPDATE ogrpg_vehicles SET model='%d', pos='%.2f,%.2f,%.2f,%.2f,%.2f,%.2f', rent='%d',text='%s', health='%d', fuel='%d', mileage='%d', frozen='%d', driver='%s', color='%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d', panelstates='%s', paintjob='%d', tuning='%s', headlights='%d,%d,%d', ownedPlayer='%d', neon='%d', mk2='%s', blokada='%s' WHERE id=%d" ,