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

Wysłany: 2019-01-06, 09:51


PropaneRPG







Wiek: 25
Na forum: 3165 dni
Posty: 40
Nick w MP: DevilLife

Piwa: 493

Respekt: 25,3

Siema mam problem bo nie wiem czemu jest limit kasy 88kk i wiecej juz sie nie da ktos wie o co chodzi?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-06, 11:03


Kuks*







Wiek: 15
Na forum: 3030 dni
Posty: 246
Nick w MP: Kuks*

Piwa: 2208

Respekt: 115,8
Respekt: 115,8

Zamiast normalnego hajsu daj el. dat?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-06, 11:07


PropaneRPG







Wiek: 25
Na forum: 3165 dni
Posty: 40
Nick w MP: DevilLife

Piwa: 493

Respekt: 25,3

"Kuks*" napisał/a:

Zamiast normalnego hajsu daj el. dat?


ale gdzie bo nie wiem

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-01-06, 13:48


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

W ca?ym gamemodzie, domy?lny system pieni?dzy GTA zmieniasz na elementDat?.
Wszystkie funkcje givePlayerMoney przekszta?casz w operacjach na elementDacie, tak samo takePlayerMoney.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-10-31, 22:19


OczuS







Wiek: 20
Na forum: 2442 dni
Posty: 66
Nick w MP: Boro

Piwa: 984

Respekt: 70

Wilq, Daj przyk?ad jak mo?esz?
Bo mam ten sam problem
Jak przekszta?ci? to w el.dat??

setPlayerMoney(plr,v.money)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-01, 00:10


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

setPlayerMoney --> setElementData(gracz, "kasa", getElementData(gracz, "kasa") + kasa)

getPlayerMoney --> getElementData(gracz, "kasa")

takePlayerMoney --> setElementData(gracz, "kasa", getElementData(gracz, "kasa") - kasa)

Oczywi?cie odpowiednio zdefiniuj gracza i zmie? nazw? elementDaty je?li masz inn?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-01, 08:20


OczuS







Wiek: 20
Na forum: 2442 dni
Posty: 66
Nick w MP: Boro

Piwa: 984

Respekt: 70

Zedytujesz mi to?
Kod:

function loadPlayerData(plr)
local result=exports["pystories-db"]:dbGet("SELECT * FROM pystories_users WHERE id=?", getElementData(plr,"player:sid"))
if result and #result > 0 then
local v=result[1]
setPlayerMoney(plr,v.money)
setElementModel(plr,v.skin)
setElementData(plr,"status","Aktywny")
setElementData(plr,"player:logged",true)
setElementData(plr,"player:mandate",v.mandate)
setElementData(plr,"player:license:pjA",v.pjA)
setElementData(plr,"player:license:pjB",v.pjB)
setElementData(plr,"player:license:pjC",v.pjC)
setElementData(plr,"player:license:pjL",v.pjL)
setElementData(plr,"player:srp",v.srp)
setElementData(plr,"player:workinjob",v.worker)
setElementData(plr,"player:registerdate",v.registered)
setElementData(plr,"player:hours",v.hours)
setElementData(plr,"player:skin",v.skin)

local queryA=string.format("SELECT * FROM pystories_users WHERE id=%d AND premiumdate>NOW() LIMIT 1", getElementData(plr,"player:sid"))
local resultA=exports["DB2"]:pobierzWyniki(queryA)
if (resultA) then
setElementData(plr,"player:premium",true)
setElementData(plr,"player:premiumdate",v.premiumdate)
setPlayerName(plr,"#C0FF00"..getPlayerName(plr))
setElementData(plr,"premium:level",1)
else
setElementData(plr,"player:premium",false)
end

local org=exports["pystories-db"]:dbGet("SELECT * FROM ms_organizacje WHERE code=? AND uid=? LIMIT 1", getElementData(plr,"player:organization"), getElementData(plr,"player:sid"))
local name = getPlayerName(plr):gsub("#%x%x%x%x%x%x","")
if org and #org > 0 then
setElementData(plr,"player:organization",org[1].code)
outputChatBox("* Jeste? w organizacji, kt?ra nosi nazwe: "..org[1].code.."", plr)
exports['pystories-db']:dbSet("UPDATE ms_organizacje SET actived=curdate() WHERE uid=?", getElementData(plr,"player:sid"))
end

return true
end
return false
end

addEvent("load:player",true)
addEventHandler("load:player", root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
loadPlayerData(player)
outputDebugString("pystories_users> Za?adowano statystyki gracza: "..getPlayerName(player))
end
end)
function savePlayerData(plr)
local sid=getElementData(plr,"player:sid")
if not sid then return end
local money=getPlayerMoney(plr)
local mandate=getElementData(plr,"player:mandate")
local licensea=getElementData(plr,"player:license:pjA")
local licenseb=getElementData(plr,"player:license:pjB")
local licensec=getElementData(plr,"player:license:pjC")
local licensel=getElementData(plr,"player:license:pjL")
local srp=getElementData(plr,"player:srp")
local worker =getElementData(plr,"player:workinjob")
local hours= tonumber(getElementData(plr,"player:hours")) or 0
local query=exports["pystories-db"]:dbSet("UPDATE pystories_users SET money=?, srp=?, mandate=?, pjA=?, pjB=?, pjC=?, pjL=?, worker=?, hours=? WHERE id=?",
money, srp, mandate, licensea, licenseb, licensec, licensel, worker, hours, sid)
end
addEvent("save:player",true)
addEventHandler("save:player", root, function(player)
if isElement(player) and player then
if getElementType(player) ~= "player" then return end
savePlayerData(player)
outputDebugString("pystories_users> Zapisano statystyki gracza: "..getPlayerName(player))
end
end)
addEventHandler("onPlayerQuit", root, function() savePlayerData(source) end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-01, 13:52


Wilq







Wiek: 24
Na forum: 4428 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Przepraszam Ci? bardzo, ale co jest trudnego w zamianie tych s??w i dodanie jednego, kolejnego? Masz rozwi?zanie podane na tacy, zawsze mo?esz op?aci? skryptera (je?li chcesz, mo?esz pisa? do mnie na PW), kt?ry b?dzie robi? to co b?dziesz chcia?. Tutaj pomagamy, a nie piszemy gotowe skrypty.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2019-11-01, 18:50


OczuS







Wiek: 20
Na forum: 2442 dni
Posty: 66
Nick w MP: Boro

Piwa: 984

Respekt: 70

Ju? mam zrobione, dzi?ki do zamkni?cia.

Postaw piwo autorowi tego posta
 

 
Tagi: limit :: kasy :: pys :: 3.0
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