• for i1, #tbl do?!
    12 replies, posted
Hello Guys I Use the Script Underdone RPG and the Script Daily Login Reward I have Complete change the Script and i can use on Underdone But now I have a problem for i=1, #tbl do -- das i=1 = du bekommst 1 Item das bedeutet wenn du bei Wood 3 machst bekommst du 4 bitte die i=1 stehen lassen if tbl[i].SpawnFunc then tbl[i].SpawnFunc(ply, tbl[i]) elseif tbl[i].Type == "udoneitems" then if ply:GetItem(strItem) then ply:AddItem(tbl[i].strItem,10) -- strItem in der Config Bearbeiten und 10 = Maximum was er bekommt ply:SaveGame() else -- Scripted by Losttime-RP.net end Where can I now register how much he should get. I have a config Day = 1, Type = "udoneitems", strItem = "wood", ID = 4, Name1 = "Items" }) The Id is the Amount He is not works
maybe you should ask the author of the gamemode?
The function for giving items in Underdone is [code] ply:AddItem("ItemName", Amount) [/code] Your English makes it impossible to understand what you want.
Commander this is not works can i use ply:AddItem("wood", Amount) ply:AddItem(strItem, Amount)? [editline]22nd March 2017[/editline] And i become Nil on the Daily Login [IMG]https://gyazo.com/74c377f31727f0c782d9047fd3546134[/IMG] [IMG]https://gyazo.com/00455568cccee22262d9e3dd42b09ab3[/IMG]
Can you post all the code please and not just parts of it?
Ok [QUOTE]Sv_Dailylogin.lua net.Receive("DailyLoginClaim", function(len, ply) if !ply.DailyLoginDay or ply.DailyLoginDay == true then return end local tbl = DBonus.Bonuses[ply.DailyLoginDay] timer.Simple(math.Clamp(9-CurTime()+ply.DailyLoginBonus, 0, 9), function() // delay for up to 9 seconds, so gamemode/addon stuff loads if !ply:IsValid() then return end sql.Query("UPDATE `dailylogin` SET `lastlogin`='"..os.time().."', `day`='"..ply.DailyLoginDay.."' WHERE `steamid`='"..ply:SteamID().."'") for i=1, #tbl do -- das i=1 = du bekommst 1 Item das bedeutet wenn du bei Wood 3 machst bekommst du 4 bitte die i=1 stehen lassen if tbl[i].SpawnFunc then tbl[i].SpawnFunc(ply, tbl[i]) elseif tbl[i].Type == "udoneitems" then if ply:AddItem(strItem) then ply:AddItem(tbl[i].strItem,Amount) -- strItem in der Config Bearbeiten und 10 = Maximum was er bekommt ply:SaveGame() else -- Scripted by Losttime-RP.net end elseif tbl[i].Type == "udoneweapons" then if ply:GetItem(strItem) then ply:AddItem(tbl[i].strItem) --strItem in der Config Bearbeiten und 10 = Maximum was er bekommt ply:SaveGame() else -- Scripted by Losttime-RP.net end elseif tbl[i].Type == "udonemoney" then if ply:GetItem(strItem) then ply:AddItem(tbl[i].strItem) --strItem in der Config Bearbeiten und 10 = Maximum was er bekommt ply:AddItem(tbl[i].amount,4) else -- Scripted by Losttime-RP.net end end end ply.DailyLoginDay = true end) end) [/QUOTE] [QUOTE]Config_dailylogin.lua DBonus.ResetAfterMaxDay = true // true to reset after it reaches the last day Ex: after day 7 it goes back to day 1, false to not DBonus.RewardOnFirstJoin = false // true for a new player to be awarded on first join, false to not DBonus.LoginCooldown = 0 // how many HOURS before a player can advance to the next day DBonus.AllowChatCommandOpen = false // true to allow to open with a chat command DBonus.ChatCommand = "!d" // if allowed above, defines the chat command name DBonus.DelayedMenuOpen = 0 // how long should the menu wait before opening in SECONDS DBonus:AddBonus({ Day = 1, Type = "udoneitems", strItem = "wood", Amount = 4, Name1 = "Items" }) [/QUOTE] [QUOTE]sh_dailylogin.lua DBonus.RewardPaint = {} // If you want to add your own reward type, add a paint Type here! DBonus.RewardPaint["udoneitems"] = function(self, x, y, tbl) x = x + 5 surface.SetDrawColor(39, 42, 51, 255)//rectangle color surface.DrawRect(x, y, 100, 100) surface.SetDrawColor(50, 50, 50, 255)//outline color surface.DrawOutlinedRect(x, y, 100, 100) draw.SimpleText("UD", "DBonus85", x+50, y+50, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER) draw.SimpleText(tbl.Amount, "DBonus20", x+50, y, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER) draw.SimpleText(tbl.Name1, "DBonus20", x+50, y+80, Color(255, 255, 255, 255), TEXT_ALIGN_CENTER) end [/QUOTE] [editline]22nd March 2017[/editline] when i write if ply:GetItem(strItem) then ply:AddItem(tbl[i].strItem,Amount) -- strItem in der Config Bearbeiten und 10 = Maximum was er bekommt ply:SaveGame() else i become one Wood Ingame and not 4 what I get 1 wood but not 4 as it is in the config I have the fear that this for i1 has to do with it
because "Amount" is not defined anywhere, use tbl[i].Amount
Where should I insert the?
ply:AddItem(tbl[i].strItem,Amount) -> ply:AddItem(tbl[i].strItem, tbl[i].Amount)
This is not true now And thanks my Friend @The Commander: If I ask you for help then you could have told me already. But thanks to all the people who helped me here Commander the report is out! That's what I call support [editline]22nd March 2017[/editline] 4 Damned nights I sat to make my script as I am relatively beginner --Close [editline]22nd March 2017[/editline] thanks @_Chewgum: You help me :) Thanks [highlight](User was banned for this post ("Don't remove all your posts in a question thread, not helpful for the future" - icemaz))[/highlight]
don't ever fucking remove all your posts again [highlight](User was banned for this post ("Report, don't flame" - Bengley))[/highlight]
I wish I could have seen what he wrote. With that amount of dumb ratings, should have been pretty interesting.
[QUOTE=MrGeekabit;51995516]I wish I could have seen what he wrote. With that amount of dumb ratings, should have been pretty interesting.[/QUOTE] It was someone who has used Google translate to translate German to French then into English demanding a addon designed for DarkRP to work with Underdone RPG.
Sorry, you need to Log In to post a reply to this thread.