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

Wysłany: 2021-10-28, 16:35


piotrek87411







Wiek: 26
Na forum: 1754 dni
Posty: 66
Nick w MP: piotrek84

Piwa: 173

Respekt: 50

frakcje z navaxy 3.0, wyp?aty z yd
W twojej Frakcji / Biznesie nie ma skonfigurowanego otrzymywania wyp?at
kod od wyp?aty
s.lua
Kod:

local factions = {
["SAPD"] = 50,
["SAFD"] = 700,
["SAMD"] = 700,
["TSA"] = 700,
["SARA"] = 700,
["ARMY"] = 700,
["San News"] = 400,
}


local text=createElement('text')
setElementPosition(text,-1749.31933, 975.15100, 24.89062-0.85)
setElementData(text,"name","Odbi?r Wyp?aty")
createMarker( -1749.31933, 975.15100, 24.89062-0.85, "cylinder", 1.3, 255, 200, 0, 150 )

function getwyplata(el,md)
local uid = getElementData(el,"player:sid")
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_factions WHERE sid=?", uid)
if #result > 0 then
if factions[result[1].code] then
if getElementData(el,"player:workinjob") and getElementData(el,"player:workinjob") >= 10 then
local money = (factions[result[1].code] * getElementData(el,"player:workinjob"))
local czas = getElementData(el,"player:workinjob")
setElementData(el,"player:workinjob",0)
exports["pystories-db"]:dbSet("UPDATE pystories_users SET worker=? WHERE id=?", "0", getElementData(el, "player:sid"))
outputChatBox("Ⓘ #FFFFFFTrwa przetwarzanie twoich danych...", el, 255, 255, 0, true)
setTimer ( function()
setElementData(el,"player:workinjob",0)
exports["pystories-db"]:dbSet("UPDATE pystories_users SET worker=? WHERE id=?", "0", getElementData(el, "player:sid"))
exports["pystories-db"]:dbSet("UPDATE pystories_factions SET wyplat=wyplat+?, ostatnia_wyplata=now() WHERE sid=?", money, getElementData(el, "player:sid"))
outputChatBox("✔ #FFFFFFOtrzymujesz "..money.." $ za przepracowane na s?u?bie "..czas.." minut!", el, 0, 255, 0, true)
givePlayerMoney(el,money)
setElementData(el,"player:workinjob",0)
end, 5000, 1)

exports["pystories-db"]:dbSet("UPDATE pystories_users SET worker=? WHERE id=?", "0", getElementData(el, "player:sid"))
setElementData(el,"player:workinjob",0)
else
outputChatBox("✘ #FFFFFFNie masz przepracowane minimum 10 minut na s?u?bie!", el, 255, 0, 0, true)
end
else
outputChatBox("Ⓘ #FFFFFFW twojej Frakcji / Biznesie nie ma skonfigurowanego otrzymywania wyp?at", el, 255, 255, 0, true)
end
end
end
addEvent("getwyplata", true)
addEventHandler("getwyplata", resourceRoot, getwyplata)


Podpis
Pseudole to autorskie serwery
Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-10-28, 17:56


TheBestv4

Przyszły programista LUA






Wiek: 30
Na forum: 2024 dni
Posty: 52
Nick w MP: Absolwent

Piwa: 838

Respekt: 50

W??cz skrypt "frakcje"
albo pystories-frakcje, nie pami?tam jak jest w navaxaya,
Je?li to nie zadzia?a to wy?lij kod z c.lua

Dodano: 2021-10-28, 17:59
Spr?buj to
https://code.skript.pl/yuB4MBIC

Postaw piwo autorowi tego posta
 

 
Wysłany: 2021-10-28, 21:18


piotrek87411







Wiek: 26
Na forum: 1754 dni
Posty: 66
Nick w MP: piotrek84

Piwa: 173

Respekt: 50

"TheBestv4" napisał/a:

W??cz skrypt "frakcje"
albo pystories-frakcje, nie pami?tam jak jest w navaxaya,
Je?li to nie zadzia?a to wy?lij kod z c.lua

Dodano: 2021-10-28, 17:59
Spr?buj to
https://code.skript.pl/yuB4MBIC

Jaki? error
https://imgur.com/a/zwRB8y5

c.lua
Kod:

--[[
authors: nanky,
script: wyplaty frakcyjne
]]

local screenW, screenH = guiGetScreenSize()
local f = dxCreateFont("f.ttf", 21)
local f2 = dxCreateFont("f.ttf", 14)

function nankymouse(x, y, w, h)
if (not isCursorShowing()) then
return false
end
local mx, my = getCursorPosition()
local fullx, fully = guiGetScreenSize()
cursorx, cursory = mx*fullx, my*fully
if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
return true
else
return false
end
end

local markery = {
{-1749.31933, 975.15100, 24.89062, 1, "Wyp?aty Frakcyjne / Biznesowe", 1},
}

for i,v in pairs(markery) do
local marker=createMarker(v[1], v[2], v[3]-1, "cylinder", v[4], 51,102,255)
local text=createElement("text")
setElementData(text,"name",v[5])
setElementPosition(text,v[1], v[2], v[3]-.27)
setElementDimension(marker, v[6])
setElementDimension(text, v[6])
panel = false

function wyplatagui()
dxDrawRectangle(screenW * 0.3510, screenH * 0.2759, screenW * 0.2974, screenH * 0.4481, tocolor(35,35,35,200), false)
dxDrawLine(screenW * 0.3510, screenH * 0.3417, screenW * 0.6469, screenH * 0.3417, tocolor(255,140,0), 1, false)
dxDrawText("ODBIERANIE WYP?AT ZE S?U?BY", screenW * 0.3505, screenH * 0.2759, screenW * 0.6484, screenH * 0.3417, tocolor(200,200,200), 1, f, "center", "center", false, false, false, false, false)
exports['yd-gui_system']:customButton('Wyp?a?', screenW * 0.4109, screenH * 0.6444, screenW * 0.0703, screenH * 0.0417)
exports['yd-gui_system']:customButton('Zamknij', screenW * 0.5115, screenH * 0.6444, screenW * 0.0708, screenH * 0.0417)
dxDrawText("Tutaj mo?esz odebra? wyp?at? frakcyjn? lub biznesow?\n\nAktualny czas na s?u?bie\n mo?esz sprawdzi? w dashboardzie (f5).", screenW * 0.2969, screenH * 0.3200, screenW * 0.6969, screenH * 0.7037, tocolor(200,200,200), 1, f2, "center", "center", false, false, false, false, false)
end


function uruchom(el,md)
if el~=localPlayer then return end
if panel == false then
addEventHandler("onClientRender",root,wyplatagui)
panel = true
showCursor(true)
end
end
addEventHandler('onClientMarkerHit',marker,uruchom)

function closepanel(button, state)
if panel and button == "left" and state == "down" then
if nankymouse(screenW * 0.5115, screenH * 0.6444, screenW * 0.0708, screenH * 0.0417) then
removeEventHandler ("onClientRender", root, wyplatagui)
panel = false
showCursor(false)
end
end
end
addEventHandler("onClientClick", getRootElement(), closepanel)

function getwyplata(button, state)
if panel and button == "left" and state == "down" then
if nankymouse(screenW * 0.4109, screenH * 0.6444, screenW * 0.0703, screenH * 0.0417) then
triggerServerEvent("getwyplata", root,localPlayer)
end
end
end
addEventHandler("onClientClick", getRootElement(), getwyplata)
end


Podpis
Pseudole to autorskie serwery
Postaw piwo autorowi tego posta
 

 
Tagi: frakcje :: nie :: działają
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » frakcje nie działają Odpowiedz do tematu

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