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

Wysłany: 2016-07-14, 15:01


Shogo12345

LuA






Wiek: 32
Na forum: 4323 dni
Posty: 48
Nick w MP: Artux

Piwa: 505

Respekt: 70

Ostrzeżeń: 100%

[Server]
local salonowePojazdy = {}
--wzor: salonowePojazdy[id_pojazdu] = cena
salonowePojazdy[478] = 2000--Walton
salonowePojazdy[549] = 10000--Tampa
salonowePojazdy[540] = 8000--Vincent
salonowePojazdy[492] = 24000--Greenwood
salonowePojazdy[405] = 25000--Sentinel
salonowePojazdy[400] = 16000--Landstalker
salonowePojazdy[542] = 13000--Clover
salonowePojazdy[445] = 19000--Admiral
salonowePojazdy[579] = 37000--Huntley
salonowePojazdy[495] = 80000--Sandking
salonowePojazdy[426] = 18000--Premier
salonowePojazdy[566] = 11000--Tahoma
salonowePojazdy[536] = 22000--Blade
salonowePojazdy[518] = 30000--Buccaner
salonowePojazdy[458] = 5000--Solair

--SPORTOWE

salonowePojazdy[496] = 24000--Blista Compact
salonowePojazdy[558] = 73100--Uranus
salonowePojazdy[602] = 85000--Alpha                  



--Motory

salonowePojazdy[461] = 15000--PCJ-600
salonowePojazdy[581] = 25000--BF-400

local salon createBlip (-1965.81,293.83,35.47-0.9,55)
local salon = createMarker(-1965.81,293.83,35.47-0.9, "cylinder", 3, 255, 0, 0, 100)

function onSalonHit(hitElement, dim)
    if getElementType(hitElement) == "player" then
    triggerClientEvent(hitElement, "pokazGUISalonu", root, salonowePojazdy)
    end
end
addEventHandler("onMarkerHit", salon, onSalonHit)

addEvent("kupPojazdSalon", true)
addEventHandler("kupPojazdSalon", getRootElement(),
function(id)
local cena = salonowePojazdy[id]
    if cena then
        if getPlayerMoney(source) >= cena then
        local account = getPlayerAccount(source)
          if account then
          local wlasciciel = getAccountName(account)
            if 2 >= getYourVehicleCount(wlasciciel) then
            takePlayerMoney(source, cena)
            triggerClientEvent(source, "potwierdzKupnoPojazduPrywatnego", root)
            fadeCamera(source, false)
                setTimer(function(source)
                local x, y, z, rot = -1990.31,275.77,35.17, 270
                local veh = createVehicle(id, x, y, z)
                setElementData(veh, "pojazd_paliwo", 50) 
                setElementData(veh, "pojazd_przebieg", 0)
                local r, g, b = getVehicleColor(veh, true)
                fadeCamera(source, true)
                --<<-->>
                local query = dbQuery(handler, "INSERT INTO pojazdy (wlasciciel, model, x, y, z, rot, ca, cb, cc, przebieg, paliwo) VALUES (?, ?, ?, ?, ?, ?,?,?,?,?,?)", wlasciciel, id, x, y, z, rot, r, g, b, 50, 0)
                local result, num_affected_rows, last_insert_id = dbPoll(query, -1)
                local r, g, b = getVehicleHeadLightColor(veh)
                dbExec(handler, "INSERT INTO tuning (id, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, paintjob, hr, hg, hb) VALUES (?, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", last_insert_id, "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "3", r, g, b)
                --<<-->>
                setElementRotation(veh, 0, 0, rot)
                ustawDanePojazdu(veh, last_insert_id, wlasciciel)
                warpPedIntoVehicle(source, veh)
                end, 1500, 1, source)
            else
            outputChatBox("Mo?esz posiada? maksymalnie 2 pojazdy.", source, 255, 255, 255, true)
            end
          end
        else
        outputChatBox("Potrzebujesz "..cena.."Eur by kupic ten pojazd.", source, 255, 255, 255, true)
        end
    end
end)

--komenda tworzaca
function stworzPojazdCMD(player, cmd, id, wlasciciel)
local acc = getAccountName (getPlayerAccount(player))
    if acc then
    if isObjectInACLGroup ("user."..acc, aclGetGroup ("Admin")) then
        if id and wlasciciel then
        local id = tonumber(id)
            if id then
                if getVehicleNameFromModel(id) then
                local x, y, z = getElementPosition(player)
                local _, _, rot = getElementRotation(player)
                
                local veh = createVehicle(id, x, y, z)
                    if veh then
                    setElementData(veh, "pojazd_paliwo", 50) --na specjalna prosbe ;)
                    setElementData(veh, "pojazd_przebieg", 0)
                    local r, g, b = getVehicleColor(veh, true)
                    --<<-->>
                    local query = dbQuery(handler, "INSERT INTO pojazdy (wlasciciel, model, x, y, z, rot, ca, cb, cc, przebieg, paliwo) VALUES (?, ?, ?, ?, ?, ?,?,?,?,?,?)", wlasciciel, id, x, y, z, rot, r, g, b, 50, 0)
                    local result, num_affected_rows, last_insert_id = dbPoll(query, -1)
                    local r, g, b = getVehicleHeadLightColor(veh)
                    dbExec(handler, "INSERT INTO tuning (id, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, paintjob, hr, hg, hb) VALUES (?, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", last_insert_id, "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "3", r, g, b)
                    --<<-->>
                    setElementRotation(veh, 0, 0, rot)
                    ustawDanePojazdu(veh, last_insert_id, wlasciciel)
                    else
                    outputChatBox("Podane ID jest niepoprawne.", player, 255, 255, 255, true)
                    end
                else
                outputChatBox("Podane ID jest niepoprawne.", player, 255, 255, 255, true)
                end
            end
        else
        outputChatBox("Wpisz /stworz [id-pojazdu] [wlasciciel]", player, 255, 255, 255, true)
        end
    end
    end
end
addCommandHandler("stworz", stworzPojazdCMD)


Ostatnio zmieniony przez Shogo12345 2016-07-15, 12:24, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-14, 15:49


_Wicek_

Majstersztyk






Wiek: 26
Na forum: 4401 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1842

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
To s? na pewno dobre kordy ?

-1965.81,293.83,35.47-0.9

Wpisz /gp i zmie? je.

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-14, 19:23


Shogo12345

LuA






Wiek: 32
Na forum: 4323 dni
Posty: 48
Nick w MP: Artux

Piwa: 505

Respekt: 70

Ostrzeżeń: 100%
Poprawi?em kordy ale i tak nie pokazuje markera.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-14, 22:29


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4471 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

[Server] 
local salonowePojazdy = {} 
--wzor: salonowePojazdy[id_pojazdu] = cena 
salonowePojazdy[478] = 2000--Walton 
salonowePojazdy[549] = 10000--Tampa 
salonowePojazdy[540] = 8000--Vincent 
salonowePojazdy[492] = 24000--Greenwood 
salonowePojazdy[405] = 25000--Sentinel 
salonowePojazdy[400] = 16000--Landstalker 
salonowePojazdy[542] = 13000--Clover 
salonowePojazdy[445] = 19000--Admiral 
salonowePojazdy[579] = 37000--Huntley 
salonowePojazdy[495] = 80000--Sandking 
salonowePojazdy[426] = 18000--Premier 
salonowePojazdy[566] = 11000--Tahoma 
salonowePojazdy[536] = 22000--Blade 
salonowePojazdy[518] = 30000--Buccaner 
salonowePojazdy[458] = 5000--Solair 

--SPORTOWE 

salonowePojazdy[496] = 24000--Blista Compact 
salonowePojazdy[558] = 73100--Uranus 
salonowePojazdy[602] = 85000--Alpha 



--Motory 

salonowePojazdy[461] = 15000--PCJ-600 
salonowePojazdy[581] = 25000--BF-400 

local salon createBlip (-1965.81,293.83,35.47-0.9,55) 
local salon = createMarker(-1965.81,293.83,34.47, "cylinder", 3, 255, 0, 0, 100) 

function onSalonHit(hitElement, dim) 
if getElementType(hitElement) == "player" then 
triggerClientEvent(hitElement, "pokazGUISalonu", root, salonowePojazdy) 
end 
end 
addEventHandler("onMarkerHit", salon, onSalonHit) 

addEvent("kupPojazdSalon", true) 
addEventHandler("kupPojazdSalon", getRootElement(), 
function(id) 
local cena = salonowePojazdy[id] 
if cena then 
if getPlayerMoney(source) >= cena then 
local account = getPlayerAccount(source) 
if account then 
local wlasciciel = getAccountName(account) 
if 2 >= getYourVehicleCount(wlasciciel) then 
takePlayerMoney(source, cena) 
triggerClientEvent(source, "potwierdzKupnoPojazduPrywatnego", root) 
fadeCamera(source, false) 
setTimer(function(source) 
local x, y, z, rot = -1990.31,275.77,35.17, 270 
local veh = createVehicle(id, x, y, z) 
setElementData(veh, "pojazd_paliwo", 50) 
setElementData(veh, "pojazd_przebieg", 0) 
local r, g, b = getVehicleColor(veh, true) 
fadeCamera(source, true) 
--<<-->> 
local query = dbQuery(handler, "INSERT INTO pojazdy (wlasciciel, model, x, y, z, rot, ca, cb, cc, przebieg, paliwo) VALUES (?, ?, ?, ?, ?, ?,?,?,?,?,?)", wlasciciel, id, x, y, z, rot, r, g, b, 50, 0) 
local result, num_affected_rows, last_insert_id = dbPoll(query, -1) 
local r, g, b = getVehicleHeadLightColor(veh) 
dbExec(handler, "INSERT INTO tuning (id, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, paintjob, hr, hg, hb) VALUES (?, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", last_insert_id, "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "3", r, g, b) 
--<<-->> 
setElementRotation(veh, 0, 0, rot) 
ustawDanePojazdu(veh, last_insert_id, wlasciciel) 
warpPedIntoVehicle(source, veh) 
end, 1500, 1, source) 
else 
outputChatBox("Mo?esz posiada? maksymalnie 2 pojazdy.", source, 255, 255, 255, true) 
end 
end 
else 
outputChatBox("Potrzebujesz "..cena.."Eur by kupic ten pojazd.", source, 255, 255, 255, true) 
end 
end 
end) 

--komenda tworzaca 
function stworzPojazdCMD(player, cmd, id, wlasciciel) 
local acc = getAccountName (getPlayerAccount(player)) 
if acc then 
if isObjectInACLGroup ("user."..acc, aclGetGroup ("Admin")) then 
if id and wlasciciel then 
local id = tonumber(id) 
if id then 
if getVehicleNameFromModel(id) then 
local x, y, z = getElementPosition(player) 
local _, _, rot = getElementRotation(player) 

local veh = createVehicle(id, x, y, z) 
if veh then 
setElementData(veh, "pojazd_paliwo", 50) --na specjalna prosbe ;) 
setElementData(veh, "pojazd_przebieg", 0) 
local r, g, b = getVehicleColor(veh, true) 
--<<-->> 
local query = dbQuery(handler, "INSERT INTO pojazdy (wlasciciel, model, x, y, z, rot, ca, cb, cc, przebieg, paliwo) VALUES (?, ?, ?, ?, ?, ?,?,?,?,?,?)", wlasciciel, id, x, y, z, rot, r, g, b, 50, 0) 
local result, num_affected_rows, last_insert_id = dbPoll(query, -1) 
local r, g, b = getVehicleHeadLightColor(veh) 
dbExec(handler, "INSERT INTO tuning (id, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, paintjob, hr, hg, hb) VALUES (?, ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)", last_insert_id, "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0", "3", r, g, b) 
--<<-->> 
setElementRotation(veh, 0, 0, rot) 
ustawDanePojazdu(veh, last_insert_id, wlasciciel) 
else 
outputChatBox("Podane ID jest niepoprawne.", player, 255, 255, 255, true) 
end 
else 
outputChatBox("Podane ID jest niepoprawne.", player, 255, 255, 255, true) 
end 
end 
else 
outputChatBox("Wpisz /stworz [id-pojazdu] [wlasciciel]", player, 255, 255, 255, true) 
end 
end 
end 
end 
addCommandHandler("stworz", stworzPojazdCMD) 
Testuj, jak nie poskutkuje wpisz /debugscript 3

I jezeli wyskocza b?edy podaj je

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-15, 12:11


Shogo12345

LuA






Wiek: 32
Na forum: 4323 dni
Posty: 48
Nick w MP: Artux

Piwa: 505

Respekt: 70

Ostrzeżeń: 100%
Nie podzia?a?o sprawdzi?em debugscript i wyskoczy?y b?edy oto one

http://screenshot.sh/m8YufnQ1p6XKI

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-15, 12:33


GabWas







Wiek: 24
Na forum: 4022 dni
Posty: 289
Nick w MP: GabWas

Piwa: 65

Respekt: 231,5
Respekt: 231,5Respekt: 231,5

Nie usun??e? "[Server]" z samej g?ry, to co si? dziwisz? :-?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-15, 13:57


BlackTen

LUA Dev.






Wiek: 28
Na forum: 4471 dni
Posty: 698

Piwa: 2080

Respekt: 157
Respekt: 157Respekt: 157

Zmie? kodowanie pliku .lua na UTF-8

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-15, 14:18


Shogo12345

LuA






Wiek: 32
Na forum: 4323 dni
Posty: 48
Nick w MP: Artux

Piwa: 505

Respekt: 70

Ostrzeżeń: 100%
Ustawi?em kodowanie na UTF-8 I Dzia?a dzieki
Temat do zamkniecia

Postaw piwo autorowi tego posta
 

 
Tagi: salon
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