Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

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

Respekt: 576,3
Respekt: 576,3

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(source50000)
        outputChatBox("* Zamontowa?e?(a?) uk?ad Turbo."source)
        setVehicleHandling(pojazd"engineAcceleration"getVehicleHandling pojazd ).engineAcceleration )
        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 )
        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(source50000)
        outputChatBox("* Zamontowa?e?(a?) uk?ad Turbo."source)
        setVehicleHandling(pojazd"engineAcceleration"getVehicleHandling pojazd ).engineAcceleration )
        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 )
        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",


Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-17, 21:49


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

A masz w zapisie to Mk?

Postaw piwo autorowi tego posta
 

 
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

Respekt: 576,3
Respekt: 576,3

"Hazmudex" napisał/a:

A masz w zapisie to Mk?

jak chodzi o mysql to mi si? zapisuje.

Podpis



Kontakt
Discord: STOPseba#7603
STOPseba na fejsie
Messenger


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-17, 22:08


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

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

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-17, 23:55


nanKy







Wiek: 22
Na forum: 3866 dni
Posty: 498
Nick w MP: nanky

Piwa: 1773

Respekt: 239
Respekt: 239Respekt: 239

STOPseba, Chodzi o to czy masz elementdate Turbo w systemie pojazd?w ( jest to system turbo z magic story )

Postaw piwo autorowi tego posta
 

 
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

Respekt: 65,3

Ostrzeżeń: 60%
Musisz doda? element date oraz rekord z wczytywaniem pojazdu w skrypcie z przechowywalnia, strona s-side.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-01-18, 15:20


mixLoLmix2

Programista






Wiek: 35
Na forum: 4113 dni
Posty: 454
Nick w MP: TomeQmix

Piwa: 1915

Respekt: 47,3

ogrpg-core/vehicle.lua I dodajesz tam wczytywanie Pojazdu z przecho :P

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
Postaw piwo autorowi tego posta
 

 
Tagi: przyspieszenie :: pojazdu
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku