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

Wysłany: 2019-02-25, 22:34


Mazeusz







Wiek: 30
Na forum: 2673 dni
Posty: 52
Nick w MP: Mazeusz*



Respekt: 50

Ostrzeżeń: 80%
Cze?? mam problem z tune mechanicznym z gm crpg dok?adnie problem istnieje w tym ?e jak chce co? kupi? to nie pobiera pieni?dzy i nie jest dodane do pojazdu.
DB3:

Kody

Server:

--[[
AutorAsper
Dla: .newMode
SkryptTuning v?w
TypServer
]]

function getVehicleHandlingProperty elementproperty )
    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

local marker createMarker(2483.531754.6110.82-3"cylinder"525500100)
local blip createBlip(2496.001761.1410.8223,2,255,0,0,255,0,100) -- PILGRIM LV    

addEvent("mTuning"true)
addEventHandler("mTuning"root, function(vic)
    if not v and not i and not c then return end
    local hand getVehicleHandlingProperty(v"driveType")
    local hajs getElementData(source"pieniadze")
    local bak getElementData(v"bak")
    bak tonumber(bak)
    if == "Zawieszenie hydrauliczne" then
        if getElementData(v"zawieszenie"then
            local cx c/2
            cx string.format("%1.2f"cx)
            setElementData(source"pieniadze"hajs+cx)
            exports["nm-noti"]:noti("Wymontowa?e? zawieszenie hydrauliczne\notrzymujesz "..cx.." PLN"source)
            setElementData(v"zawieszenie"false)
            exports.mysql:wykonaj("UPDATE pojazdy SET zawieszenie=0 WHERE id=?"getElementData(v"id"))
        else
            if hajs c then
                c string.format("%1.2f"c)
                setElementData(source"pieniadze"hajs-c)
                exports["nm-noti"]:noti("Zamontowa?e? zawieszenie hydrauliczne\nza cene "..c.." PLN"source)
                setElementData(v"zawieszenie"2)
                exports.mysql:wykonaj("UPDATE pojazdy SET zawieszenie=1 WHERE id=?"getElementData(v"id"))
            else
                exports["nm-noti"]:noti("Brak wystarczaj?cych funduszy."source)
            end
        end
    elseif == "Nap?d FWD" then
        if hand == "fwd" then 
            exports["nm-noti"]:noti("Posiadasz ju? zainstalowany nap?d FWD."source)
            return 
        end
        if hajs c then
            c string.format("%1.2f"c)
            setElementData(source"pieniadze"hajs-c)
            exports["nm-noti"]:noti("Zamontowa?e? nap?d FWD\nza cene "..c.." PLN"source)
            setVehicleHandling(v"driveType""fwd")
            exports.mysql:wykonaj("UPDATE pojazdy SET naped=? WHERE id=?""fwd"getElementData(v"id"))
        else
            exports["nm-noti"]:noti("Brak wystarczaj?cych funduszy."source)
        end
    elseif == "Nap?d RWD" then
        if hand == "rwd" then 
            exports["nm-noti"]:noti("Posiadasz ju? zainstalowany nap?d RWD."source)
            return 
        end
        if hajs c then
            c string.format("%1.2f"c)
            setElementData(source"pieniadze"hajs-c)
            exports["nm-noti"]:noti("Zamontowa?e? nap?d RWD\nza cene "..c.." PLN"source)
            setVehicleHandling(v"driveType""rwd")
            exports.mysql:wykonaj("UPDATE pojazdy SET naped=? WHERE id=?""rwd"getElementData(v"id"))
        else
            exports["nm-noti"]:noti("Brak wystarczaj?cych funduszy."source)
        end
    elseif == "Nap?d AWD" then
        if hand == "awd" then 
            exports["nm-noti"]:noti("Posiadasz ju? zainstalowany nap?d AWD."source)
            return 
        end
        if hajs c then
            c string.format("%1.2f"c)
            setElementData(source"pieniadze"hajs-c)
            exports["nm-noti"]:noti("Zamontowa?e? nap?d AWD\nza cene "..c.." PLN"source)
            setVehicleHandling(v"driveType""awd")
            exports.mysql:wykonaj("UPDATE vy SET naped=? WHERE id=?""awd"getElementData(v"id"))
        else
            exports["nm-noti"]:noti("Brak wystarczaj?cych funduszy."source)
        end
    elseif == "Bak 50L" then
        if bak == 50 then 
            exports["nm-noti"]:noti("Pojazd posiada ju? bak 50L."source)
            return 
        end
        if bak == 100 or bak == 75 then 
            exports["nm-noti"]:noti("Nie mo?esz zmniejszy? baku vu."source)
            return 
        end
        if hajs c then
            c string.format("%1.2f"c)
            setElementData(source"pieniadze"hajs-c)
            exports["nm-noti"]:noti("Zamontowa?e? bak 50L\nza cene "..c.." PLN"source)
            setElementData(v"bak"50)
            exports.mysql:wykonaj("UPDATE pojazdy SET bak=50 WHERE id=?"getElementData(v"id"))
        else
            exports["nm-noti"]:noti("Brak wystarczaj?cych funduszy."source)
        end
    elseif == "Bak 75L" then
        if bak == 75 then 
            exports["nm-noti"]:noti("Pojazd posiada ju? bak 75L."source)
            return 
        end
        if bak == 100 then 
            exports["nm-noti"]:noti("Nie mo?esz zmniejszy? baku vu."source)
            return 
        end
        if hajs c then
            c string.format("%1.2f"c)
            setElementData(source"pieniadze"hajs-c)
            exports["nm-noti"]:noti("Zamontowa?e? bak 75L\nza cene "..c.." PLN"source)
            setElementData(v"bak"75)
            exports.mysql:wykonaj("UPDATE pojazdy SET bak=75 WHERE id=?"getElementData(v"id"))
        else
            exports["nm-noti"]:noti("Brak wystarczaj?cych funduszy."source)
        end
    elseif == "Bak 100L" then
        if bak == 100 then 
            exports["nm-noti"]:noti("Pojazd posiada ju? bak 100L."source)
            return 
        end
        if hajs c then
            c string.format("%1.2f"c)
            setElementData(source"pieniadze"hajs-c)
            exports["nm-noti"]:noti("Zamontowa?e? bak 100L\nza cene "..c.." PLN"source)
            setElementData(v"bak"100)
            exports.mysql:wykonaj("UPDATE pojazdy SET bak=100 WHERE id=?"getElementData(v"id"))
        else
            exports["nm-noti"]:noti("Brak wystarczaj?cych funduszy."source)
        end
-- MK1 ----------------------------------------------------------------------------------
-- MK1 ----------------------------------------------------------------------------------
    elseif == "MK1" then
        if getElementData(v,"veh:mk1") == 1 then 
            exports["crpg_powiadomienia"]:noti("#FF0000✖#FFFFFF Ten pojazd posiada zamontowane MK1!"source)    
            return 
        end
        if hajs c then
            c string.format("%1.2f"c)
            setElementData(source"pieniadze"hajs-c)
            exports["crpg_powiadomienia"]:noti("#00FF00✔#FFFFFF Zamontowa?e? MK1 za "..c.." PLN!"source)    
            local handling getVehicleHandling(v)
            setVehicleHandling(v"engineAcceleration"handling.engineAcceleration+0.75)
            setElementData(v"veh:mk1"1)
            exports.mysql:wykonaj("UPDATE pojazdy SET mk1=? WHERE id=?""1"getElementData(v"id"))
        else
            exports["crpg_powiadomienia"]:noti("#FF0000✖#FFFFFF Nie posiadasz pieni?dzy na zakup MK1!"source)
        end
-- MK2 ----------------------------------------------------------------------------------
-- MK2 ----------------------------------------------------------------------------------        
    elseif == "MK2" then
        if getElementData(v,"veh:mk2") == 1 then 
            exports["crpg_powiadomienia"]:noti("#FF0000✖#FFFFFF Ten pojazd posiada zamontowane MK2!"source)    
            return 
        end
        if hajs c then
            c string.format("%1.2f"c)
            setElementData(source"pieniadze"hajs-c)
            exports["crpg_powiadomienia"]:noti("#00FF00✔#FFFFFF Zamontowa?e? MK2 za "..c.." PLN!"source)    
            local handling getVehicleHandling(v)
            setVehicleHandling(v"engineAcceleration"handling.engineAcceleration+1.25)
            setElementData(v"veh:mk2"1)
            exports.mysql:wykonaj("UPDATE pojazdy SET mk2=? WHERE id=?""1"getElementData(v"id"))
        else
            exports["crpg_powiadomienia"]:noti("#FF0000✖#FFFFFF Nie posiadasz pieni?dzy na zakup MK2!"source)    
        end
-- MK3 ----------------------------------------------------------------------------------
-- MK3 ----------------------------------------------------------------------------------        
            elseif == "MK3" then
        if getElementData(v,"veh:mk3") == 1 then 
            exports["crpg_powiadomienia"]:noti("#FF0000✖#FFFFFF Ten pojazd posiada zamontowane MK3!"source)            
            return 
        end
        if hajs kasa then
            c string.format("%1.2f"c)
            setElementData(source"pieniadze"hajs-c)
            exports["crpg_powiadomienia"]:noti("#00FF00✔#FFFFFF Zamontowa?em MK3 za "..kasa.." PLN!"source)            
            local handling getVehicleHandling(v)
            setVehicleHandling(v"maxVelocity"handling.maxVelocity+15)
            setVehicleHandling(v"engineAcceleration"handling.engineAcceleration+2)
            setElementData(v"veh:mk3"1)
            exports.mysql:wykonaj("UPDATE pojazdy SET mk3=? WHERE id=?""1"getElementData(v"id"))
        else
            exports["crpg_powiadomienia"]:noti("#FF0000✖#FFFFFF Nie posiadasz pieni?dzy na zakup MK3!"source)    
        end
        --[[    elseif == "UP4 - Przyspieszenie,pr?dko?? maksymalna" then
        if getElementData(v,"up4"then 
            exports["nm-noti"]:noti("Pojazd posiada ju? UP4."source)
            return 
        end
        if hajs c then
            c string.format("%1.2f"c)
            setElementData(source"pieniadze"hajs-c)
            exports["nm-noti"]:noti("Zamontowa?e? UP4\nza cene "..c.." PLN"source)
            local handling getVehicleHandling(v)
            setVehicleHandling(v"maxVelocity"handling.maxVelocity+8)
            setVehicleHandling(v"engineAcceleration"handling.engineAcceleration+1.2)
            setElementData(v"up4"true)
            exports.mysql:wykonaj("UPDATE pojazdy SET duklad=1 WHERE id=?"getElementData(v"id"))
        else
            exports["nm-noti"]:noti("Brak wystarczaj?cych funduszy."source)
        end]]
    if == "CB Radio" then
        if getElementData(v"veh:cb"then
            local cx c/2
            setElementData(source"pieniadze"hajs+cx)
            exports["nm-noti"]:noti("Wymontowa?e? CB-radio\notrzymujesz "..cx.." PLN"source)
            setElementData(v"veh:cb"false)
            exports.mysql:wykonaj("UPDATE pojazdy SET cb=0 WHERE id=?"getElementData(v"id"))
        else
            if hajs c then
                setElementData(source"pieniadze"hajs-c)
                exports["nm-noti"]:noti("Zamontowa?e? CB-radio\nza cene "..c.." PLN"source)
                setElementData(v"veh:cb"1)
                exports.mysql:wykonaj("UPDATE pojazdy SET cb=1 WHERE id=?"getElementData(v"id"))
            else
                exports["nm-noti"]:noti("Brak wystarczaj?cych funduszy."source)
            end
        end
    end
    end
end)


Client:

--[[
AutorAsper
Dla: .newMode
SkryptTuning pojazd?w
TypClient
]]

local sxsy guiGetScreenSize()
local cuboid createColCuboid(2135.73, -2192.6213.10435)  
local wb guiCreateGridList(0.400.110.190.17true)
local nazwa guiGridListAddColumn(wb"Nazwa"0.4)
local cena guiGridListAddColumn(wb"Cena"0.2)
guiSetVisible(wbfalse)

function mysz(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

local tuning = {
{"MK1"35000},
{"MK2"55000},
{"MK3"75000},
{"CB Radio",10000},
{"Zawieszenie hydrauliczne"30000},
{"Nap?d FWD"10000},
{"Nap?d RWD"10000},
{"Nap?d AWD"15000},
{"Bak 50L"15000},
{"Bak 75L"30000},
{"Bak 100L"45000},
}

local screenWscreenH guiGetScreenSize()

local czcionka dxCreateFont(":crpg_fonty/f.ttf"14)
if not czcionka then czcionka "default-bold" end

function dxDrawButton(xywhcolor)
  local color2 tocolor(0,94,254)
  dxDrawRectangle(xywhcolorfalse)
  dxDrawRectangle(2141colorfalse)
  dxDrawRectangle(x-0.4660164h-1.6w+1.52color2false)
  dxDrawRectangle(1213colorfalse)
  dxDrawRectangle(w213colorfalse)
end

function gui()
        dxDrawButton(screenW 0.3792screenH 0.0370screenW 0.2313screenH 0.3346tocolor(151515200))
        dxDrawRectangle(screenW 0.3788screenH 0.0360screenW 0.2320screenH 0.0580tocolor(094254200), false)
        dxDrawBorderedText("Tuning Mechaniczny"screenW 0.7600screenH 0.0725screenW 0.2320screenH 0.0580tocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
          if mysz(screenW 0.3909screenH 0.2948screenW 0.0996screenH 0.0599then
            dxDrawButton(screenW 0.3909screenH 0.2948screenW 0.0996screenH 0.0599tocolor(094254175), false)
        else
            dxDrawButton(screenW 0.3909screenH 0.2948screenW 0.0996screenH 0.0599tocolor(151515175), false)
        end
           if mysz(screenW 0.5007screenH 0.2948screenW 0.0996screenH 0.0599then
            dxDrawButton(screenW 0.5007screenH 0.2948screenW 0.0996screenH 0.0599tocolor(094254175), false)
        else
            dxDrawButton(screenW 0.5007screenH 0.2948screenW 0.0996screenH 0.0599tocolor(151515175), false)
        end      
        dxDrawBorderedText("Akceptuj"screenW 0.3909screenH 0.0948screenW 0.4905screenH 0.5547tocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
        dxDrawBorderedText("Anuluj"screenW 0.5000screenH 0.0948screenW 0.5996screenH 0.5547tocolor(255255255255), 1.00czcionka"center""center"falsefalsefalsefalsefalse)
end

addEventHandler("onClientClick"root, function(bs)
    if ~= "state" and ~= "down" then return end
    if mysz(screenW 0.5007screenH 0.2948screenW 0.0996screenH 0.0599) and guiGetVisible(wb) == true then
        setElementData(localPlayer"hud"false)        
        guiSetVisible(wbfalse)
        showCursor(false)    
        showChat(true)
          showPlayerHudComponent("radar"true)            
        local p getPedOccupiedVehicle(localPlayer)
        setElementFrozen(pfalse)
        removeEventHandler("onClientPreRender"rootgui)
    elseif mysz(screenW 0.3909screenH 0.2948screenW 0.0996screenH 0.0599) and guiGetVisible(wb) == true then
        local wy guiGridListGetSelectedItem(wb)
        local nazwa guiGridListGetItemText(wbwy1)
        local cena guiGridListGetItemText(wbwy2)
        cena tonumber(cena)
        local p getPedOccupiedVehicle(localPlayer)
        triggerServerEvent("mTuning"localPlayerpnazwacena)
    end
end)

addEventHandler("onClientMarkerHit"resourceRoot, function(hit)
    if hit ~= localPlayer then return end
    if not isPedInVehicle(hitthen return end
    if #getElementsWithinColShape(cuboid, "vehicle") == 1 then
        exports["nm-noti"]:noti("Tuning jest w tej chwili u?ywany.")
        return
    end
    local p getPedOccupiedVehicle(hit)
    if getVehicleController(p) ~= hit then return end
    if getElementData(p"wlasciciel") ~= getElementData(hit"dbid"then return end
    setElementData(localPlayer"hud"true)    
    guiSetVisible(wbtrue)
    showCursor(true)    
    showChat(false)    
      showPlayerHudComponent("radar"false)        
    setElementFrozen(ptrue)
    addEventHandler("onClientPreRender"rootgui)
end)

function dxDrawBorderedTexttextxywhcolorscalefontalignXalignYclipwordBreakpostGUI )
    dxDrawText text:gsub('#%x%x%x%x%x%x'''), 1111tocolor 000255 ), scalefontalignXalignYclipwordBreakfalse )
    dxDrawText text:gsub('#%x%x%x%x%x%x'''), 1111tocolor 000255 ), scalefontalignXalignYclipwordBreakfalse )
    dxDrawText text:gsub('#%x%x%x%x%x%x'''), 1111tocolor 000255 ), scalefontalignXalignYclipwordBreakfalse )
    dxDrawText text:gsub('#%x%x%x%x%x%x'''), 1111tocolor 000255 ), scalefontalignXalignYclipwordBreakfalse )
    dxDrawText text:gsub('#%x%x%x%x%x%x'''), 1y1htocolor 000255 ), scalefontalignXalignYclipwordBreakfalse )
    dxDrawText text:gsub('#%x%x%x%x%x%x'''), 1y1htocolor 000255 ), scalefontalignXalignYclipwordBreakfalse )
    dxDrawText text:gsub('#%x%x%x%x%x%x'''), x1w1tocolor 000255 ), scalefontalignXalignYclipwordBreakfalse )
    dxDrawText text:gsub('#%x%x%x%x%x%x'''), x1w1tocolor 000255 ), scalefontalignXalignYclipwordBreakfalse )
    dxDrawText textxywhcolorscalefontalignXalignYclipwordBreakpostGUItrue )
end

addEventHandler("onClientResourceStart"resourceRoot, function()
    for k,v in ipairs(tuning) do
        local r guiGridListAddRow(wb)
        guiGridListSetItemText(wbrnazwav[1], falsefalse)
        local cx v[2]
        cx string.format("%1.2f"cx)
        guiGridListSetItemText(wbrcenacxfalsefalse)
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-26, 18:19


ReDsKill







Wiek: 24
Na forum: 3256 dni
Posty: 35
Nick w MP: ReDsKill

Piwa: 1581

Respekt: 40,5

Paczka z kt?rej bra?e? owy skrypt mia?a swoje el daty "pieniadze" domy?lam si? ?e masz paczk? ogrpg wi?c spr?buj:
takePlayerMoney
oraz
getPlayerMoney

Podpis
Aktualny projekt: Santori RPG

Discord serwera: https://discord.gg/2BFEuSW
Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-26, 18:34


Mazeusz







Wiek: 30
Na forum: 2673 dni
Posty: 52
Nick w MP: Mazeusz*



Respekt: 50

Ostrzeżeń: 80%
Mam paczke pys. Tylko co mam spr?bowa? z tym takePlayerMoney i getPlayerMoney

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-02-26, 20:44


Gravgor







Wiek: 22
Na forum: 3619 dni
Posty: 380
Nick w MP: 1944

Piwa: 702

Respekt: 57,8

Musisz te edaty pozamienia? na takePlayerMoney oraz getPlayerMoney, inaczej tego nie rozwi??esz.

Podpis
Portfolio marceliborowczak.me
Postaw piwo autorowi tego posta
 

 
Tagi: tune :: mechaniczne :: nie :: dziala
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