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

Wysłany: 2018-02-03, 10:07


Rainbow_Flow

Programista






Wiek: 26
Na forum: 3653 dni
Posty: 15
Nick w MP: raRe`



Respekt: 50

CREATE TABLE `rpg_frakcje` (
`id` int(11) NOT NULL,
`faction` text NOT NULL,
`rank_1` text NOT NULL,
`rank_2` text NOT NULL,
`rank_3` text NOT NULL,
`rank_4` text NOT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

jak ta tabela ma wygl?da? mo?na ca?o?? kto? podes?a??

a i od razu bo w tym GM nie dzia?aj? te? 2 prace Fabryka i Dwoda jak je naprawi??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-03, 14:00


maksio41

Uczeń Lua






Wiek: 27
Na forum: 3188 dni
Posty: 30
Nick w MP: maksior411

Piwa: 2

Respekt: 50

Ostrzeżeń: 100%
Znalaz?em tutaj tabele own world:
http://www.gtao.pl/%3Cfon...da-vt115694.htm

Podpis
Uczę się LUA!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-03, 14:18


Rainbow_Flow

Programista






Wiek: 26
Na forum: 3653 dni
Posty: 15
Nick w MP: raRe`



Respekt: 50

to nie to

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-03, 14:37


Qwertick

Coming soon...






Wiek: 23
Na forum: 3577 dni
Posty: 472
Nick w MP: Qwertick

Piwa: 2726

Respekt: 215,8
Respekt: 215,8Respekt: 215,8

Tabela tak powinna wygl?da?
Kod:

-- --------------------------------------------------------

--
-- Struktura tabeli dla tabeli `rpg_frakcje`
--

CREATE TABLE `rpg_frakcje` (
`id` int(11) NOT NULL,
`faction` text NOT NULL,
`rank_1` text NOT NULL,
`rank_2` text NOT NULL,
`rank_3` text NOT NULL,
`rank_4` text NOT NULL,
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

A co do prac daj kod :)

Podpis

Kontakt
Discord: Qwertick#1210

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-03, 15:46


Rainbow_Flow

Programista






Wiek: 26
Na forum: 3653 dni
Posty: 15
Nick w MP: raRe`



Respekt: 50

Kod:

local starts = {
{ped={-71.966911315918, -267.33529663086, 7.8980102539063, 270}, marker={-71.06287689209, -267.32583618164, 7.8980102539063}},
}

function load_fabryka_table()
local q = exports.rpg_mysql:mysql_query("select * from rpg_accounts order by punkty_fabryka desc")
local ranking_table = {}

for i = 1,5 do
table.insert(ranking_table, q[i]["username"]..": "..q[i]["punkty_fabryka"].." punkt?w")
end

return ranking_table
end

addEventHandler("onResourceStart", resourceRoot, function ()
for i,v in ipairs(starts) do
local x1,y1,z1, rz = unpack(v.ped)
local ped = createPed(165, x1, y1, z1, rz)
setElementData(ped, "name", "Pracodawca")
setElementFrozen(ped, true)
setElementDimension(ped, 68)

local x2,y2,z2 = unpack(v.marker)
local marker = createMarker(x2, y2, z2-1, "cylinder", 1.1, 255, 255, 255, 100)

addEventHandler("onMarkerHit", marker, markerHit)
addEventHandler("onMarkerLeave", marker, markerLeave)
setElementDimension(marker, 68)
end
end)

function markerHit(hit, dim)
if getElementType(hit) ~= "player" then return end
if isPedInVehicle(hit) then return end
triggerClientEvent(hit, "createJobsWindow", hit, {job_name, job_uid, load_fabryka_table(), job_level1_desc, job_level2_desc, job_level3_desc, job_level1_points, job_level2_points, job_level3_points, job_level1_prawko, job_level2_prawko, job_level3_prawko, job_data})
end

function markerLeave(hit, dim)
if getElementType(hit) ~= "player" then return end
if isPedInVehicle(hit) then return end
triggerClientEvent(hit, "destroyJobsWindow", hit)
end

local widlak = {}
local dft = {}
local zaladunek = {}
local tir = {}
local tir_pojazdy1 = {}
local tir_pojazdy2 = {}

local skrzynka = {}

addEvent("skrzynka:fabryka", true)
addEventHandler("skrzynka:fabryka", root, function(x)
local veh = getPedOccupiedVehicle(source)
if not veh then return end
if not skrzynka[source] and not x then
skrzynka[source] = createObject(1271, 0, 0, 0)
setElementDimension(skrzynka[source], 68)
setObjectScale(skrzynka[source], 1.5)
attachElements(skrzynka[source], veh, 0, 0.7, 0.3)
setElementCollisionsEnabled(skrzynka[source], false)
else
if not skrzynka[source] then return end
destroyElement(skrzynka[source])
skrzynka[source] = false
end
end)

local los_model = {
422,
445,
467,
603,
543,
576,
475,
533,
529,
}

addEventHandler("onPlayerStartJob", root, function(_,level)
if getElementData(source, "user:job") ~= job_uid then return end
if level == 1 then
setElementFrozen(source, true)
fadeCamera(source, false)
local player = source
setTimer(function()
setElementFrozen(player, false)
fadeCamera(player, true)
widlak[player] = createVehicle(530, -74.700752258301, -266.83715820313, 6.3813467025757, 0, 0, 360)
triggerClientEvent(root, "ghost:vehicle", root, widlak[player])
setElementData(widlak[player], "owner", player)
setVehicleDamageProof(widlak[player], true)
setElementData(widlak[player], "veh:job", true)
setTimer(function()
warpPedIntoVehicle(player, widlak[player])
end, 500, 1)
setElementDimension(widlak[player], 68)
exports.rpg_noti:createNotification(player, "info", "Udaj si? do czarnego punktu po paczke")
end, 2500, 1)
elseif level == 2 then
setElementFrozen(source, true)
fadeCamera(source, false)
local player = source
setTimer(function()
setElementFrozen(player, false)
fadeCamera(player, true)
dft[player] = createVehicle(578, -114.92974853516, -249.35609436035, 7.2684397697449, 0, 0, 180)
setElementData(dft[player], "owner", player)
triggerClientEvent(root, "ghost:vehicle", root, dft[player])
setElementDimension(dft[player], 68)
setElementData(dft[player], "veh:job", true)
zaladuj(player)
setTimer(function()
warpPedIntoVehicle(player, dft[player])
end, 500, 1)
exports.rpg_noti:createNotification(player, "info", "Udaj si? do czarnego punktu po paczke")
end, 2500, 1)
elseif level == 3 then
setElementFrozen(source, true)
fadeCamera(source, false)
local player = source
setTimer(function()
setElementFrozen(player, false)
fadeCamera(player, true)
tir[player] = createVehicle(443, -14.741955757141, -280.54354858398, 6.0633759498596, 0, 0, 180)
setElementData(tir[player], "owner", player)
triggerClientEvent(root, "ghost:vehicle", root, tir[player])
warpPedIntoVehicle(player, tir[player])
setControlState(player, "special_control_down", true)
setElementDimension(tir[player], 0)
setElementData(tir[player], "veh:job", true)
setTimer(function()
warpPedIntoVehicle(player, tir[player])
end, 500, 1)
exports.rpg_noti:createNotification(player, "info", "Udaj si? do czarnego punktu po paczke")
end, 2500, 1)
end
end)

function zaladuj(player)
if zaladunek[player] then
if zaladunek[player] and isElement(zaladunek[player]) then
destroyElement(zaladunek[player])
zaladunek[player] = false
end
end
local rnd = math.random(1,#los_model)
local model = los_model[rnd]
zaladunek[player] = createVehicle(model, -124.44546508789, -240.86869812012, 7.5581169128418, 0, 0, 180)
setElementAlpha(zaladunek[player], 0)
setElementCollisionsEnabled(zaladunek[player], false)
setElementDimension(zaladunek[player], 68)
setElementFrozen(zaladunek[player], true)
setElementData(dft[player], "zaladunek", zaladunek[player])
triggerClientEvent(player, "alpha", resourceRoot, zaladunek[player])
end
addEvent("zaladunek", true)
addEventHandler("zaladunek", resourceRoot, zaladuj)


addEventHandler("onVehicleStartEnter", resourceRoot, function(player)
for i,v in ipairs(getElementsByType("player")) do
if zaladunek[v] and source == zaladunek[v] then
cancelEvent()
end
end
end)

addEvent("auto:tir", true)
addEventHandler("auto:tir", root, function(tp)
if not tir[source] then return end
local veh = getPedOccupiedVehicle(source)
if tp == 1 then
if veh and veh == tir_pojazdy1[source] then
removePedFromVehicle(source)
attachElements(tir_pojazdy1[source], tir[source], 0, -1.5, 0.5)
setElementCollisionsEnabled(tir_pojazdy1[source], false)
else
detachElements(tir_pojazdy1[source])
warpPedIntoVehicle(source, tir_pojazdy1[source])
setElementCollisionsEnabled(tir_pojazdy1[source], true)
end
elseif tp == 2 then
if veh and veh == tir_pojazdy2[source] then
removePedFromVehicle(source)
attachElements(tir_pojazdy2[source], tir[source], 0, -1.5, 0.5)
setElementCollisionsEnabled(tir_pojazdy2[source], false)
else
detachElements(tir_pojazdy2[source])
warpPedIntoVehicle(source, tir_pojazdy2[source])
setElementCollisionsEnabled(tir_pojazdy2[source], true)
end
end
end)

addEvent("auto:tird", true)
addEventHandler("auto:tird", root, function(tp)
if tp == 1 then
if tir_pojazdy1[source] and isElement(tir_pojazdy1[source]) then
destroyElement(tir_pojazdy1[source])
tir_pojazdy1[source] = false
end
attachElements(tir_pojazdy2[source], tir[source], 0, -1.5, 0.5)
elseif tp == 2 then
if tir_pojazdy2[source] and isElement(tir_pojazdy2[source]) then
destroyElement(tir_pojazdy2[source])
tir_pojazdy2[source] = false
end
end
end)

addEvent("auta:tir", true)
addEventHandler("auta:tir", root, function()
if not tir[source] then return end
local rnd1 = math.random(1,#los_model)
local model1 = los_model[rnd1]
local rnd2 = math.random(1,#los_model)
local model2 = los_model[rnd2]
tir_pojazdy1[source] = createVehicle(model1, 0, 0, 0)
tir_pojazdy2[source] = createVehicle(model2, 0, 0, 0)
setElementData(tir_pojazdy1[source], "pojazd_tir", true)
setElementData(tir_pojazdy2[source], "pojazd_tir", true)
attachElements(tir_pojazdy1[source], tir[source], 0, -1.5, 0.5)
attachElements(tir_pojazdy2[source], tir[source], 0, -1.5, 2.5)
setElementCollisionsEnabled(tir_pojazdy1[source], false)
setElementCollisionsEnabled(tir_pojazdy2[source], false)
setElementData(tir_pojazdy1[source], "attached", true)
setElementData(tir_pojazdy2[source], "attached", true)
end)

addEvent("give:spray", true)
addEventHandler("give:spray", root, function(t)
if t ~= true then
takeWeapon(source, 41)
elseif t == true then
giveWeapon(source, 41, 999)
end
end)

addEvent("set:fabryka:color", true)
addEventHandler("set:fabryka:color", root, function(v,color)
local player = source
if not dft[player] then return end
fadeCamera(player, false)
setElementFrozen(player, true)
setTimer(function()
local r,g,b = unpack(color)
setVehicleColor(v, r, g, b)
setElementFrozen(player, false)
warpPedIntoVehicle(player, dft[player])
fadeCamera(player, true)
setElementCollisionsEnabled(v, false)
setElementAlpha(v, 255)
attachElements(v, dft[player], 0, -0.9, 0.65)
end, 1500, 1)
end)

addEvent("alpha:vehicle", true)
addEventHandler("alpha:vehicle", root, function(v,t)
if t then
detachElements(v)
setElementPosition(v, -103.59055328369, -250.84272766113, 7.417950630188)
setElementRotation(v, 0, 0, 270)
setElementCollisionsEnabled(v, false)
setElementAlpha(v, 0)
triggerClientEvent(source, "alpha", resourceRoot, v)
else
local veh = getPedOccupiedVehicle(source)
setElementAlpha(v, 255)
attachElements(v, veh, 0, -0.9, 0.65)
end
end)

function stopJob(player,window)
if getElementData(player, "user:job") ~= job_uid then return end
takeWeapon(player, 41)
if widlak[player] and isElement(widlak[player]) then
destroyElement(widlak[player])
widlak[player] = false
end
if dft[player] and isElement(dft[player]) then
destroyElement(dft[player])
dft[player] = false
end
if zaladunek[player] and isElement(zaladunek[player]) then
destroyElement(zaladunek[player])
zaladunek[player] = false
end
if tir[player] and isElement(tir[player]) then
destroyElement(tir[player])
tir[player] = false
end
if tir_pojazdy1[player] and isElement(tir_pojazdy1[player]) then
destroyElement(tir_pojazdy1[player])
tir_pojazdy1[player] = false
end
if tir_pojazdy2[player] and isElement(tir_pojazdy2[player]) then
destroyElement(tir_pojazdy2[player])
tir_pojazdy2[player] = false
end
if skrzynka[player] then
destroyElement(skrzynka[player])
skrzynka[player] = false
end
triggerClientEvent(player, "stopjob:fabryka", player)
if not window then
setTimer(function()
if player and isElement(player) then
exports["rpg_noti"]:createNotification(player, "error", "Praca zosta?a zako?czona")
if getElementDimension(player) ~= 68 then
fadeCamera(player, false)
setElementFrozen(player, true)
setTimer(function()
setElementPosition(player, -66.61043548584, -266.88391113281, 7.8990135192871)
setElementInterior(player, 0)
setElementDimension(player, 68)
end, 1000, 1)
setTimer(function()
fadeCamera(player, true)
setElementFrozen(player, false)
end, 2000, 1)
end
end
end, 150, 1)
end
end
addEvent("stopjob:fabryka", true)
addEventHandler("stopjob:fabryka", root, stopJob)

addEventHandler("onPlayerResign", root, function(player,window)
if getElementData(player, "user:job") ~= job_uid then return end
stopJob(player,window)
end)

addEventHandler("onPlayerWasted", root, function()
if getElementData(source, "user:job") ~= job_uid then return end
stopJob(source,false)
end)

addEventHandler("onVehicleStartEnter", resourceRoot, function(player, seat)
if seat ~= 0 then return end
local owner = getElementData(source, "owner")
if owner and owner ~= player then
cancelEvent()
end
end)

addEventHandler("onPlayerQuit", root, function()
local player = source
if widlak[player] and isElement(widlak[player]) then
destroyElement(widlak[player])
widlak[player] = false
end
if dft[player] and isElement(dft[player]) then
destroyElement(dft[player])
dft[player] = false
end
if zaladunek[player] and isElement(zaladunek[player]) then
destroyElement(zaladunek[player])
zaladunek[player] = false
end
if tir[player] and isElement(tir[player]) then
destroyElement(tir[player])
tir[player] = false
end
if tir_pojazdy1[player] and isElement(tir_pojazdy1[player]) then
destroyElement(tir_pojazdy1[player])
tir_pojazdy1[player] = false
end
if tir_pojazdy2[player] and isElement(tir_pojazdy2[player]) then
destroyElement(tir_pojazdy2[player])
tir_pojazdy2[player] = false
end
if skrzynka[player] then
destroyElement(skrzynka[player])
skrzynka[player] = false
end
end)

addEventHandler("onVehicleExit", resourceRoot, function(player)
if widlak[player] and widlak[player] == source then
stopJob(player,false)
end
end)

local pojazdy = {
--dft
{578, -147.57623291016, -289.44702148438, 7.2608299255371, 90},
{578, -147.57623291016, -275.89297485352, 7.2608299255371, 90},
{578, -147.57623291016, -261.6494140625, 7.2608299255371, 90},
--bobcat
{422, -50.091053009033, -257.48886108398, 6.6278219223022, 0},
{422, -47.718486785889, -257.52890014648, 6.6239047050476, 0},
{422, -45.199733734131, -257.50302124023, 6.532609462738, 0},
--admiral
{445, -42.912181854248, -257.48321533203, 6.4587736129761, 0},
{445, -40.601852416992, -257.51745605469, 6.4866094589233, 0},
{445, -38.074771881104, -257.64828491211, 6.4970207214355, 0},
--centauro
{526, -49.801261901855, -244.71542358398, 6.3838686943054, 180},
{526, -47.42448425293, -244.84352111816, 6.410270690918, 180},
--cabie
{467, -44.866497039795, -244.69583129883, 6.5775933265686, 360},
{467, -42.453399658203, -244.55526733398, 6.5457353591919, 180},
--phoenix
{603, -42.256481170654, -238.23257446289, 6.4708194732666, 180},
--sadler
{543, -44.873611450195, -238.19857788086, 6.4420118331909, 360},
--tornado
{576, -49.792930603027, -237.93702697754, 6.2491779327393, 360},
--sabre
{475, -47.279624938965, -238.32933044434, 6.4491882324219, 180},
--feltzer
{533, -32.34204864502, -249.79100036621, 6.3047471046448, 90},
{533, -32.437400817871, -252.57955932617, 6.3313474655151, 90},
--imponte
{529, -32.83984375, -255.0036315918, 6.3505692481995, 90},
{529, -32.765590667725, -257.86706542969, 6.3505692481995, 90},
{529, -32.683818817139, -260.47485351563, 6.3505692481995, 90},
{529, -32.877170562744, -263.03588867188, 6.3505692481995, 90},
{529, -32.887775421143, -265.60635375977, 6.3505692481995, 90},
--tir
{443, -13.420251846313, -261.93930053711, 6.0527234077454, 180},
{443, -21.812183380127, -261.93930053711, 6.0527234077454, 180},
--zacieta maszynka xDD
{605, -132.79463195801, -240.74229431152, 7.7068061828613, 180},
}

for i,v in ipairs(pojazdy) do
local v = createVehicle(v[1], v[2], v[3], v[4], 0, 0, v[5])
setElementDimension(v, 68)
setElementFrozen(v, true)
setVehicleLocked(v, true)
end

addEvent("give:moneyANDpoints", true)
addEventHandler("give:moneyANDpoints", resourceRoot, function(player, money, points)
local uid = getElementData(player, "user:uid")
local q = exports.rpg_mysql:mysql_query("update rpg_accounts set punkty_fabryka=punkty_fabryka+?, jobmoney=jobmoney+? where uid=?", points, money, uid)
end)


[ Dodano: 2018-02-03, 15:49 ]
co do kodu Static analysis:

1 b??d?w zosta?o znalezionych podczas analizy.

A symbol name was expected! (near ")" at position 297)
Zapytanie SQL:

-- -------------------------------------------------------- -- -- Struktura tabeli dla tabeli `rpg_frakcje` -- CREATE TABLE `rpg_frakcje` ( `id` int(11) NOT NULL, `faction` text NOT NULL, `rank_1` text NOT NULL, `rank_2` text NOT NULL, `rank_3` text NOT NULL, `rank_4` text NOT NULL, ) ENGINE=InnoDB DEFAULT CHARSET=latin1

MySQL zwr?ci? komunikat: Dokumentacja

#1064 - Something is wrong in your syntax obok ') ENGINE=InnoDB DEFAULT CHARSET=latin1' w linii 14

Ostatnio zmieniony przez Iggy 2018-02-05, 15:22, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-03, 17:11


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

Powy?ej umie?? odpowiednie znaczniki lua jak i code. Do tego z jakiej paczki potrzebujesz tabele? Rozwi? swe my?li bo jak na razie nic nie wiadomo

Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-04, 09:04


Rainbow_Flow

Programista






Wiek: 26
Na forum: 3653 dni
Posty: 15
Nick w MP: raRe`



Respekt: 50

potrzebuje bazy z paczki OWN WORLD V2 bo t? co mam nie ma tebeli RPG_FRAKCJE

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-04, 12:29


Ciastuuś

Truck soon...






Wiek: 26
Na forum: 3071 dni
Posty: 799
Nick w MP: Ciastuuś

Piwa: 4297

Respekt: 640
Respekt: 640Respekt: 640

"Rainbow_Flow" napisał/a:

potrzebuje bazy z paczki OWN WORLD V2 bo t? co mam nie ma tebeli RPG_FRAKCJE


Prosz?,

Kod:

CREATE TABLE IF NOT EXISTS `rpg_factions` (
`id` int(11) NOT NULL,
`user` int(11) NOT NULL,
`username` text CHARACTER SET latin7 NOT NULL,
`frakcja` text NOT NULL,
`rank` int(11) NOT NULL,
`wyplata` float NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;


Podpis
Truck soon...
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-02-05, 15:34


WaskiGaming







Wiek: 48
Na forum: 3042 dni
Posty: 6



Respekt: 50

"Ciastuu?" napisał/a:

"Rainbow_Flow" napisał/a:

potrzebuje bazy z paczki OWN WORLD V2 bo t? co mam nie ma tebeli RPG_FRAKCJE


Prosz?,

Kod:

CREATE TABLE IF NOT EXISTS `rpg_factions` (
`id` int(11) NOT NULL,
`user` int(11) NOT NULL,
`username` text CHARACTER SET latin7 NOT NULL,
`frakcja` text NOT NULL,
`rank` int(11) NOT NULL,
`wyplata` float NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;


Wstawi?em podan? tabel?, lecz dalej nie mog? wej?? na duty

Postaw piwo autorowi tego posta
 

 
Tagi: baza :: mysql :: own :: world
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