Hi,
ich habe folgendes Problem. Ich habe versucht in:
Lua: allround.lua
function fstate_func(player)
local frac = vioGetElementData ( player, "fraktion" )
if frac > 0 then
if frac == 1 then
outputChatBox ( factionDepotData["money"][1].."$", player, 200, 200, 0 )
if frac == 6 then
outputChatBox ( factionDepotData["money"][6].."$", player, 200, 200, 0 )
if frac == 8 then
outputChatBox ( factionDepotData["money"][8].."$", player, 200, 200, 0 )
elseif frac == 5 then
outputChatBox ( factionDepotData["money"][frac].."$", player, 200, 200, 0 )
elseif frac == 10 or frac == 11 then
outputChatBox ( factionDepotData["money"][10] .. "$ | " .. factionDepotData["drugs"][10] .. "g Drogen | " .. factionDepotData["mats"][10] .. " Materialien", player, 200, 200, 0 )
else
outputChatBox ( factionDepotData["money"][frac] .. "$ | " .. factionDepotData["drugs"][frac] .. "g Drogen | " .. factionDepotData["mats"][frac] .. " Materialien", player, 200, 200, 0 )
end
end
end
addCommandHandler ( "fstate", fstate_func )
Alles anzeigen
Lua: functions.lua
function fdraw_func ( player, cmd, amount )
local frac = vioGetElementData ( player, "fraktion" )
if frac == 1 then
if vioGetElementData ( player, "rang" ) >= 5 then
local amount = tonumber ( amount )
if amount then
amount = math.abs ( math.floor ( amount ) )
if factionDepotData["money"][1] >= amount then
factionDepotData["money"][1] = factionDepotData["money"][1] - amount
vioSetElementData ( player, "money", vioGetElementData ( player, "money" ) + amount)
outputLog ( getPlayerName(player).." hat "..amount.." $ aus der Staatskasse genommen.", "fkasse" )
else
infobox ( player, "\n\nEs ist nicht mehr\ngenug Geld in der\nKasse!", 7500, 125, 0, 0 )
end
else
infobox ( player, "\n\n\nGebrauch: /fdraw [Summe]", 7500, 125, 0, 0 )
end
else
infobox ( player, "\n\n\nDu bist nicht\nbefugt!", 7500, 125, 0, 0 )
end
if frac == 6 then
if vioGetElementData ( player, "rang" ) >= 5 then
local amount = tonumber ( amount )
if amount then
amount = math.abs ( math.floor ( amount ) )
if factionDepotData["money"][6] >= amount then
factionDepotData["money"][6] = factionDepotData["money"][6] - amount
vioSetElementData ( player, "money", vioGetElementData ( player, "money" ) + amount)
outputLog ( getPlayerName(player).." hat "..amount.." $ aus der Staatskasse genommen.", "fkasse" )
else
infobox ( player, "\n\nEs ist nicht mehr\ngenug Geld in der\nKasse!", 7500, 125, 0, 0 )
end
else
infobox ( player, "\n\n\nGebrauch: /fdraw [Summe]", 7500, 125, 0, 0 )
end
else
infobox ( player, "\n\n\nDu bist nicht\nbefugt!", 7500, 125, 0, 0 )
end
if frac == 8 then
if vioGetElementData ( player, "rang" ) >= 5 then
local amount = tonumber ( amount )
if amount then
amount = math.abs ( math.floor ( amount ) )
if factionDepotData["money"][8] >= amount then
factionDepotData["money"][8] = factionDepotData["money"][8] - amount
vioSetElementData ( player, "money", vioGetElementData ( player, "money" ) + amount)
outputLog ( getPlayerName(player).." hat "..amount.." $ aus der Staatskasse genommen.", "fkasse" )
else
infobox ( player, "\n\nEs ist nicht mehr\ngenug Geld in der\nKasse!", 7500, 125, 0, 0 )
end
else
infobox ( player, "\n\n\nGebrauch: /fdraw [Summe]", 7500, 125, 0, 0 )
end
else
infobox ( player, "\n\n\nDu bist nicht\nbefugt!", 7500, 125, 0, 0 )
end
elseif frac == 5 then
if vioGetElementData ( player, "rang" ) >= 4 then
local amount = tonumber ( amount )
if amount then
amount = math.abs ( math.floor ( amount ) )
local fmoney = factionDepotData["money"][5]
if fmoney >= amount then
factionDepotData["money"][5] = factionDepotData["money"][5] - amount
vioSetElementData ( player, "money", vioGetElementData ( player, "money" ) + amount)
outputLog ( getPlayerName(player).." hat "..amount.." $ aus der Reporterkasse genommen.", "fkasse" )
else
infobox ( player, "\n\nEs ist nicht mehr\ngenug Geld in der\nKasse!", 7500, 125, 0, 0 )
end
else
infobox ( player, "\n\n\nGebrauch: /fdraw [Summe]", 7500, 125, 0, 0 )
end
else
infobox ( player, "\n\n\nDu bist nicht\nbefugt!", 7500, 125, 0, 0 )
end
elseif frac == 10 or frac == 11 then
if vioGetElementData ( player, "rang" ) >= 4 then
local amount = tonumber ( amount )
if amount then
amount = math.abs ( math.floor ( amount ) )
local fmoney = factionDepotData["money"][10]
if fmoney >= amount then
factionDepotData["money"][10] = factionDepotData["money"][10] - amount
vioSetElementData ( player, "money", vioGetElementData ( player, "money" ) + amount)
outputLog ( getPlayerName(player).." hat "..amount.." $ aus der Reporterkasse genommen.", "fkasse" )
else
infobox ( player, "\n\nEs ist nicht mehr\ngenug Geld in der\nKasse!", 7500, 125, 0, 0 )
end
else
infobox ( player, "\n\n\nGebrauch: /fdraw [Summe]", 7500, 125, 0, 0 )
end
else
infobox ( player, "\n\n\nDu bist nicht\nbefugt!", 7500, 125, 0, 0 )
end
end
end
addCommandHandler ( "fdraw", fdraw_func )
Alles anzeigen
Es so umzuschreiben, dass jede Staatsfraktion seine eigene Kasse hat. Bei der fbank Funktion stell ich mich bislang immernoch irgendwie blöd an, doch jedoch bekomme ich nach editierung dieser beiden Funktionen auf das was ich beigefügt habe einen fraktionmember error in der register.
Er sagt dann er kann die Spieler nicht zuordnen.
Fehler: register_login_server.lua:816: attempt to index global 'fraktionMembers' (a nil value)
Ich wollte fragen, ob da villeicht jemand eine Ahnung hat was falsch ist, und mir eventuell helfen könnte dabei.