Jump to content

Search the Community

Showing results for tags 'not solved'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News & Announcements
    • News
  • Project Zomboid
    • PZ Updates
    • General Discussions
    • Bug Reports
    • PZ Support
    • PZ Multiplayer
    • PZ Community & Creativity
    • PZ Suggestions
  • PZ Modding
    • Tutorials & Resources
    • Mods
    • Items
    • Mapping
    • Mod Ideas and Requests
  • General Games Development
    • Indie Scene
  • Other Discussions
    • General Discussion
    • Forum Games & Activities

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Twitter


Interests

Found 1 result

  1. For Cheat Menu V2.5, I've seen numerous reports that the menu creates 50+ context menus instead of 1. I've come to understand that this is because of my code used to check if a player is admin. Here's the code in question: CheatCoreCM.isAdmin = function() -- stops pesky cheaters. good luck trying to modify this, it won't work :^) if isClient() == true and isAdmin() == true or isClient() == false and isAdmin() == false then return true else return false end end CheatCoreCM.shouldStart = function() if CheatCoreCM.isAdmin() then print("[CHEAT MENU] User "..getOnlineUsername().." is authorized! This message will appear the next time the client connects.") Events.OnPlayerUpdate.Add(CheatCoreCM.DoCheats); Events.OnTick.Add(CheatCoreCM.DoTickCheats); Events.OnMouseDown.Add(CheatCoreCM.SpawnZombieNow); Events.OnKeyKeepPressed.Add(CheatCoreCM.OnKeyKeepPressed); Events.OnKeyPressed.Add(CheatCoreCM.OnKeyPressed); Events.OnPlayerMove.Add(CheatCoreCM.updateCoords); Events.OnFillWorldObjectContextMenu.Add(ISUICheatMenu.createMenuEntries); Events.OnMouseMove.Add(CheatCoreCM.highlightSquare); Events.OnTick.Remove(CheatCoreCM.shouldStart); elseif not CheatCoreCM.isAdmin() and CheatCoreCM.doNotWarn ~= true then print("[CHEAT MENU] User "..getOnlineUsername().." is not authorized! This message will appear the next time the client connects.") CheatCoreCM.doNotWarn = true end end Events.OnTick.Add(CheatCoreCM.shouldStart); What it does is that it checks if the player is an admin, then it creates the rest of the events that Cheat Menu's various cheat functions use. It also creates the menu. Theoretically, it won't fire at all for non-admins. But what if the player has been made an admin after the check has been performed? Since otherwise it would require the player to exit & re-enter the server, I decided to hook the function to an OnTick event. Now, this is where the problem is. What's happening is that the admin check is passed, but for whatever reason Events.OnTick.Remove(CheatCoreCM.shouldStart) refuses to fire. Here's an error log that one of my afflicted users have given me: Line # 1126 is where I called Events.OnTick.Remove(CheatCoreCM.shouldStart). Cheat Menu successfully printed the success message to the console, curiously with Lenny101 as the username (I assume that's just the default username for singleplayer. Either that, or Lenny101 is a wizard and is bending spacetime to break my mod.) So the function successfully fires, the isAdmin() check passes, and for whatever reason Events.OnTick.Remove is no longer a thing. Because of this, Cheat Menu is now cloning itself on every tick event since the OnTick check is still there. The logical conclusion would have been that I messed up and I could at least close the loop through another way. However, this bug does not happen to me. It does not happen to my friends, it doesn't even happen if I install PZ onto another computer and test the mod on that. The numerous reports I have received confirm that this bug is present. It's happening to multiple people, and I cannot figure out why. Some of the reporters had also said they are using Windows 10, the same operating system I am using. The specs also range wildly. Previously I had just used a global variable that, if set to true (which it is when the check passes), the function does nothing. Then, in the current version, I made the function straight up remove the event after completing the setup (as seen above). Same issue, same users. I am very, very confused as to why this is happening. It only happens to some people, sometimes, for some reason, and I cannot figure out why. There's always a reason as to why a problem occurs in programming, so this simply isn't random. There is a reason for this, but I cannot figure it out. And thus, I request for help from the kind folks here. EDIT: Okay, it turns out that ISUICheatMenu loaded after CheatCoreForCheatMenu was loaded. CheatCoreForCheatMenu was trying to hook a non-existent function to an event. I simply cut and paste CheatCoreCM.shouldStart() to ISUICheatMenu.lua. I'm an idiot. Edit 2: MMnnnnnope. Still doesn't work for a select few users, with the same error as before, despite moving the admin checking code over to ISUICheatMenu. Again, it still works fine for me, but not for some users. Why is this?
×
×
  • Create New...