• Print

Author Topic: Hello , Gamemode Under ( Weird Errors ) - Help  (Read 4189 times)

0 Members and 1 Guest are viewing this topic.

Offline Schiaffino

  • Jr. Member
  • **
  • Posts: 88
  • Karma: 1
Hello , Gamemode Under ( Weird Errors ) - Help
« on: July 08, 2012, 12:35:04 pm »
Hello guys First of all ( Thanks for All The Support ) =) Well , a few days ago , i was working with a gamemode , and now i put it on the ( Dedicated Server ) but i receive some errors :/
Like:



( Not THe ULX , Its Something Else, Well This Lines:

Trying To Open " Q Menu " ( Inventory , Character Skills Area )

Code: Lua
  1.  
  2. If you know what is the problem here , i hope you can help me =)
  3.  
  4. Thanks ,
  5.  
  6. Schiaffino
  7.  
  8. PD: Sorry for my bad spelling , im from spain =)
  9.  
  10. function GM:OnSpawnMenuOpen()
  11.         if !LocalPlayer().Data then return end
  12.         GAMEMODE.MainMenu = GAMEMODE.MainMenu or vgui.Create("mainmenu")
  13.         GAMEMODE.MainMenu:Center()
  14.         GAMEMODE.MainMenu:SetTargetAlpha(255)
  15.         GAMEMODE.MainMenu.Frame:SetVisible(true)
  16.         gui.EnableScreenClicker(true)
  17.         RestoreCursorPosition()
  18.         GAMEMODE.MainMenu.PlayersTab:LoadPlayers()
  19.         GAMEMODE.MainMenu.InventoryTab:ReloadAmmoDisplay()
  20.         GAMEMODE.MainMenu.CharacterTab:LoadHeader()
  21.         GAMEMODE.MainMenu.CharacterTab:LoadMasters()
  22. end
  23.  
  24.  

Line 59 Error

Code: Lua
  1.         GAMEMODE.MainMenu.InventoryTab:ReloadAmmoDisplay()
  2.  

When You Log Into This Server

Code: Lua
  1.  
  2. if SERVER then
  3.         hook.Add("PlayerSpawn", "PlayerSpawn_Stats", function(ply)
  4.                 for name, stat in pairs(GAMEMODE.DataBase.Stats) do
  5.                         if ply.Stats then
  6.                                 ply:SetStat(name, ply:GetStat(name))
  7.                                 if stat.OnSpawn then
  8.                                         stat:OnSpawn(ply, ply:GetStat(name))
  9.                                 end
  10.                         end
  11.                 end
  12.                 ply:AddStat("stat_agility", ply.ToMakeUpAgility or 0)
  13.                 ply.ToMakeUpAgility = 0
  14.         end)
  15. end
  16.  
  17. if CLIENT then
  18.         usermessage.Hook("UD_UpdateStats", function(usrMsg)
  19.                 LocalPlayer():SetStat(usrMsg:ReadString(), usrMsg:ReadLong())
  20.         end
  21.  
  22.  

Line 49 Error

Code: Lua
  1.                 LocalPlayer():SetStat(usrMsg:ReadString(), usrMsg:ReadLong())
  2.  

Offline Assault_Trooper

  • Newbie
  • *
  • Posts: 20
  • Karma: 1
    • Trooper's Gaming Servers
Re: Hello , Gamemode Under ( Weird Errors ) - Help
« Reply #1 on: July 08, 2012, 03:08:01 pm »
You need to search where the items are added to the menu, since wherever PlayersTab is added to the GAMEMODE.MainMenu, InventoryTab isn't being added.

The SetStat function is propably server-side only, you need to check if it really is being sent to the client.

  • Print