• DarkRP Problem with F4 menu
    7 replies, posted
[B]So, me and my friend are making a Gamemode, but we get this problem and we don't know how to fix it, please help![/B] [CODE][ERROR] gamemodes/sdgwars/gamemode/client/showteamtabs.lua:287: bad argument #1 to 'SetText' (string expected, got nil) 1. SetText - [C]:-1 2. Update - gamemodes/sdgwars/gamemode/client/showteamtabs.lua:287 3. MoneyTab - gamemodes/sdgwars/gamemode/client/showteamtabs.lua:339 4. Function - gamemodes/sdgwars/gamemode/client/vgui.lua:258 5. unknown - lua/includes/modules/usermessage.lua:87 [/CODE] [B]And this is how it look in game:[/B] [URL="http://i.imgur.com/ZU0oU3j.jpg"]http://i.imgur.com/ZU0oU3j.jpg[/URL]
You called the function "settext" but didn't put in the right type of paremeters. As a matter of fact, you didn't put in anything at all. Go back and check your code where the function is called. Go check recently changed files and find "settext" and post back here what the code says. I will try to help but what I can do is kind of limited because I don't have access to your files.
What files do you need?, i can upload them and send them to you.
Show us your showteamtabs, don't upload, just post here.
[code] CreateClientConVar("rp_playermodel", "", true, true) local function MayorOptns() local MayCat = vgui.Create("DCollapsibleCategory") function MayCat:Paint() self:SetBGColor(team.GetColor(LocalPlayer():Team())) end MayCat:SetLabel("Mayor options") local maypanel = vgui.Create("DListLayout") maypanel:SetSize(740,170) local SearchWarrant = maypanel:Add("DButton") SearchWarrant:SetText(LANGUAGE.searchwarrantbutton) SearchWarrant.DoClick = function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if not ply.DarkRPVars.warrant and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() Derma_StringRequest("Warrant", "Why would you warrant "..ply:Nick().."?", nil, function(a) LocalPlayer():ConCommand("darkrp /warrant \"".. ply:SteamID().."\" ".. a) end, function() end ) end) end end menu:Open() end local Warrant = maypanel:Add("DButton") Warrant:SetText(LANGUAGE.make_wanted) Warrant.DoClick = function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if not ply.DarkRPVars.wanted and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() Derma_StringRequest("wanted", "Why would you make "..ply:Nick().." wanted?", nil, function(a) LocalPlayer():ConCommand("darkrp /wanted \"".. ply:SteamID().."\" ".. a) end, function() end ) end) end end menu:Open() end local UnWarrant = maypanel:Add("DButton") UnWarrant:SetText(LANGUAGE.make_unwanted) UnWarrant.DoClick = function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if ply.DarkRPVars.wanted and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() LocalPlayer():ConCommand("darkrp /unwanted \"" .. ply:SteamID() .. "\"") end) end end menu:Open() end local Lockdown = maypanel:Add("DButton") Lockdown:SetText(LANGUAGE.initiate_lockdown) Lockdown.DoClick = function() LocalPlayer():ConCommand("darkrp /lockdown") end local UnLockdown = maypanel:Add("DButton") UnLockdown:SetText(LANGUAGE.stop_lockdown) UnLockdown.DoClick = function() LocalPlayer():ConCommand("darkrp /unlockdown") end local Lottery = maypanel:Add("DButton") Lottery:SetText(LANGUAGE.start_lottery) Lottery.DoClick = function() LocalPlayer():ConCommand("darkrp /lottery") end local GiveLicense = maypanel:Add("DButton") GiveLicense:SetText(LANGUAGE.give_license_lookingat) GiveLicense.DoClick = function() LocalPlayer():ConCommand("darkrp /givelicense") end local PlaceLaws = maypanel:Add("DButton") PlaceLaws:SetText("Place a screen containing the laws.") PlaceLaws.DoClick = function() LocalPlayer():ConCommand("darkrp /placelaws") end local AddLaws = maypanel:Add("DButton") AddLaws:SetText("Add a law.") AddLaws.DoClick = function() Derma_StringRequest("Add a law", "Type the law you would like to add here.", "", function(law) LocalPlayer():ConCommand("darkrp /addlaw " .. law) end) end local RemLaws = maypanel:Add("DButton") RemLaws:SetText("Remove a law.") RemLaws.DoClick = function() Derma_StringRequest("Remove a law", "Enter the number of the law you would like to remove here.", "", function(num) LocalPlayer():ConCommand("darkrp /removelaw " .. num) end) end MayCat:SetContents(maypanel) MayCat:SetSkin("DarkRP") return MayCat end local function CPOptns() local CPCat = vgui.Create("DCollapsibleCategory") function CPCat:Paint() self:SetBGColor(team.GetColor(LocalPlayer():Team())) end CPCat:SetLabel("Police options") local CPpanel = vgui.Create("DListLayout") CPpanel:SetSize(740,170) local SearchWarrant = CPpanel:Add("DButton") SearchWarrant:SetText(LANGUAGE.request_warrant) SearchWarrant.DoClick = function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if not ply.DarkRPVars.warrant and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() Derma_StringRequest("Warrant", "Why would you warrant "..ply:Nick().."?", nil, function(a) LocalPlayer():ConCommand("darkrp /warrant \"".. ply:SteamID().."\" ".. a) end, function() end ) end) end end menu:Open() end local Warrant = CPpanel:Add("DButton") Warrant:SetText(LANGUAGE.searchwarrantbutton) Warrant.DoClick = function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if not ply.DarkRPVars.wanted and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() Derma_StringRequest("wanted", "Why would you make "..ply:Nick().." wanted?", nil, function(a) if not IsValid(ply) then return end LocalPlayer():ConCommand("darkrp /wanted \"".. ply:SteamID().."\" ".. a) end, function() end ) end) end end menu:Open() end local UnWarrant = CPpanel:Add("DButton") UnWarrant:SetText(LANGUAGE.unwarrantbutton) UnWarrant.DoClick = function() local menu = DermaMenu() for _,ply in pairs(player.GetAll()) do if ply.DarkRPVars.wanted and ply ~= LocalPlayer() then menu:AddOption(ply:Nick(), function() LocalPlayer():ConCommand("darkrp /unwanted \"" .. ply:SteamID() .. "\"") end) end end menu:Open() end if LocalPlayer():Team() == TEAM_CHIEF or LocalPlayer():IsAdmin() then local SetJailPos = CPpanel:Add("DButton") SetJailPos:SetText(LANGUAGE.set_jailpos) SetJailPos.DoClick = function() LocalPlayer():ConCommand("darkrp /jailpos") end local AddJailPos = CPpanel:Add("DButton") AddJailPos:SetText(LANGUAGE.add_jailpos) AddJailPos.DoClick = function() LocalPlayer():ConCommand("darkrp /addjailpos") end end local ismayor -- Firstly look if there's a mayor local ischief -- Then if there's a chief for k,v in pairs(player.GetAll()) do if v:Team() == TEAM_MAYOR then ismayor = true break end end if not ismayor then for k,v in pairs(player.GetAll()) do if v:Team() == TEAM_CHIEF then ischief = true break end end end local Team = LocalPlayer():Team() if not ismayor and (Team == TEAM_CHIEF or (not ischief and Team == TEAM_POLICE)) then local GiveLicense = CPpanel:Add("DButton") GiveLicense:SetText(LANGUAGE.give_license_lookingat) GiveLicense.DoClick = function() LocalPlayer():ConCommand("darkrp /givelicense") end end CPCat:SetContents(CPpanel) CPCat:SetSkin("DarkRP") return CPCat end local function CitOptns() local CitCat = vgui.Create("DCollapsibleCategory") function CitCat:Paint() self:SetBGColor(team.GetColor(LocalPlayer():Team())) end CitCat:SetLabel("Citizen options") local Citpanel = vgui.Create("DListLayout") Citpanel:SetSize(740,110) local joblabel = Citpanel:Add("DLabel") joblabel:SetText(LANGUAGE.set_custom_job) local jobentry = Citpanel:Add("DTextEntry") jobentry:SetValue(LocalPlayer().DarkRPVars.job or "") jobentry.OnEnter = function() LocalPlayer():ConCommand("darkrp /job " .. tostring(jobentry:GetValue())) end jobentry.OnLoseFocus = jobentry.OnEnter CitCat:SetContents(Citpanel) CitCat:SetSkin("DarkRP") return CitCat end local function MobOptns() local MobCat = vgui.Create("DCollapsibleCategory") function MobCat:Paint() self:SetBGColor(team.GetColor(LocalPlayer():Team())) end MobCat:SetLabel("Mobboss options") local Mobpanel = vgui.Create("DListLayout") Mobpanel:SetSize(740,110) local agendalabel = Mobpanel:Add("DLabel") agendalabel:SetText(LANGUAGE.set_agenda) local agendaentry = Mobpanel:Add("DTextEntry") agendaentry:SetValue(LocalPlayer().DarkRPVars.agenda or "") agendaentry.OnEnter = function() LocalPlayer():ConCommand("darkrp /agenda " .. tostring(agendaentry:GetValue())) end agendaentry.OnLoseFocus = agendaentry.OnEnter MobCat:Set
Night, you mean its Our showteamtabs.lua :D
Looks like you're missing a [Lua]go_to_sleep = "Go to sleep/wake up",[/lua] in your language.lua file. Look what it's like here: [url]https://github.com/FPtje/DarkRP/blob/master/gamemode/shared/language.lua#L176[/url] --- Oh btw, there is a DarkRP Help Thread. See here: [url]http://facepunch.com/showthread.php?t=1249475[/url]
Thanks alot, it work! :3
Sorry, you need to Log In to post a reply to this thread.