Wysłany: 2017-01-17, 20:35
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" ,
Wysłany: 2017-01-17, 21:49
_Haze
Peace Yo!
Wiek: 24 Na forum: 4184 dni Posty: 1648
Nick w MP: Haze
Piwa : 2628
Wysłany: 2017-01-17, 21:54
STOPseba
Emeryt na scenie MTA
Wiek: 25 Na forum: 3771 dni Posty: 448
Nick w MP: STOPseba
Piwa : 5014
"Hazmudex" napisał/a :
jak chodzi o mysql to mi si? zapisuje.
Wysłany: 2017-01-17, 22:08
amited
Wiek: 26 Na forum: 3714 dni Posty: 1233
Nick w MP: Amited
Piwa : 512
STOPseba , Gdy pobierasz auto z przecho ustawiasz element dat? na pojazd je?eli mk2=1 i gdy wsiada do pojazdu to ustawi si? automatycznie handling
Wysłany: 2017-01-17, 23:55
nanKy
Wiek: 22 Na forum: 3866 dni Posty: 498
Nick w MP: nanky
Piwa : 1773
STOPseba , Chodzi o to czy masz elementdate Turbo w systemie pojazd?w ( jest to system turbo z magic story )
Wysłany: 2017-01-18, 08:48
Kibol1908.
Good Boy
Wiek: 27 Na forum: 4111 dni Posty: 69
Nick w MP: Hello_Boy
Piwa : 99
Musisz doda? element date oraz rekord z wczytywaniem pojazdu w skrypcie z przechowywalnia, strona s-side.
Wysłany: 2017-01-18, 15:20
mixLoLmix2
Programista
Wiek: 35 Na forum: 4113 dni Posty: 454
Nick w MP: TomeQmix
Piwa : 1915
ogrpg-core/vehicle.lua I dodajesz tam wczytywanie Pojazdu z przecho
Podpis
Zajmuję się pisaniem zaawansowanych skryptów lua na zamówienie za bardzo niską cene.
Oraz pomoc przy serwerze mta/forum i tym podobnych.
Discord: TomeQmix#7106
Tagi: przyspieszenie :: pojazdu
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: