Much of cider and admin don't work anymore after 20 minutes

Hello,

I have a server with cider on it and ulx. It works perfectly for 20 minutes or something like that, and after that I can’t change jobs and I can’t use any admin commands.

I have tried to reinstall cider and citrus but it keeps crashing after 20 minutes.

Can someone help me?

I discovered that it crashes randomly between 1 and 20 minutes. The cider commands and admin commands don’t work anymore than.

Check server logs for errors. Post your findings

[lua]L 09/12/2009 - 18:45:26: Lua Error: Timer Error: ULib/server/util.lua:120: attempt to call field ‘GetAll’ (a nil value)
L 09/12/2009 - 18:45:27: Lua Error: Timer Error: cider\gamemode\core/plugins/banfrags/sv_init.lua:49: attempt to call field ‘GetAll’ (a nil value)
L 09/12/2009 - 18:45:28: Lua Error: Timer Error: cider\gamemode\core/plugins/banfrags/sv_init.lua:49: attempt to call field ‘GetAll’ (a nil value)
L 09/12/2009 - 18:45:29: Lua Error: Timer Error: cider\gamemode\core/plugins/banfrags/sv_init.lua:49: attempt to call field ‘GetAll’ (a nil value)[/lua]

This is spamming the whole logs. Line 49 in sv_init.lua is:
[lua] for k, v in pairs( player.GetAll() ) do[/lua]

[lua]L 09/12/2009 - 18:42:28: Lua Error: ERROR: Hook ‘ULibInitPlayer’ Failed: ULib/server/ucl.lua:725: attempt to call field ‘GetAll’ (a nil value)
L 09/12/2009 - 18:42:28: Lua Error: Removing Hook ‘ULibInitPlayer’[/lua]
[lua]L 09/12/2009 - 18:39:40: Lua Error: ERROR: Hook ‘ULXLogVehicleSpawn’ Failed: ulx\log.lua:222: attempt to call field ‘GetAll’ (a nil value)
L 09/12/2009 - 18:39:40: Lua Error: Removing Hook ‘ULXLogVehicleSpawn’[/lua]

also found that

Very weird. That line looks ok to me. Give me the lines 39 to 59 please

So, you’re running ULX and Cider at the same time? I don’t think that’s a good idea.

Yes I’m running ULX 3.40 and Ulib 2.30 and Cider at the same time. I also tried Citrus and than I have same problem.

Line 39 to 59:

[lua] return false;
end;
end;
end;

– Add the hook.
cider.hook.add(“PlayerCanGainFrag”, PLUGIN.playerFragsAdd);

– Create a timer to check frags every second.
timer.Create(tostring(PLUGIN), 1, 0, function()
for k, v in pairs( player.GetAll() ) do
if ( !v:IsAdmin() ) then
local frags = 9000;
local uniqueID = v:UniqueID();

		-- Check if the player's frags table.
		if ( PLUGIN.frags[uniqueID] and CurTime() > PLUGIN.frags[uniqueID] ) then
			PLUGIN.frags[uniqueID] = CurTime() + 3600;
			
			-- Set the player's kill reset time so that we can get it client side.
			cider.player.setLocalPlayerVariable( v, CLASS_LONG, "_KillResetTime", PLUGIN.frags[uniqueID] ); [/lua]

Somewhere you have put player = something, and that has overwritten the main player table. Post the whole plugin.

sv_init.lua
[lua]
–[[
Name: “sv_init.lua”.
Product: “Cider (Roleplay)”.
–]]

local PLUGIN = {};

– Create a variable to store the plugin for the shared file.
PLUGIN_SHARED = PLUGIN;

– Include the shared file and add it to the client download list.
include(“sh_init.lua”);
AddCSLuaFile(“sh_init.lua”);

– Define a new table to store frags.
PLUGIN.frags = {};

– Called when a player has initialized.
function PLUGIN.playerInitialized(player)
if ( !PLUGIN.frags[ player:UniqueID() ] ) then
PLUGIN.frags[ player:UniqueID() ] = CurTime() + 3600;

	-- Set the player's kill reset time so that we can get it client side.
	cider.player.setLocalPlayerVariable( player, CLASS_LONG, "_KillResetTime", PLUGIN.frags[ player:UniqueID() ] );
	
	-- Reset the player's frags.
	player:SetFrags(0);
end;

end;

– Add the hook.
cider.hook.add(“PlayerInitialized”, PLUGIN.playerInitialized);

– Called when a player should gain a frag.
function PLUGIN.playerFragsAdd(player, victim)
if (player._Warranted == “arrest”) then
if (victim:Team() == TEAM_COMBINEOFFICER or victim:Team() == TEAM_COMBINEOVERWATCH
or victim:Team() == TEAM_CITYADMINISTRATOR) then
return false;
end;
end;
end;

– Add the hook.
cider.hook.add(“PlayerCanGainFrag”, PLUGIN.playerFragsAdd);

– Create a timer to check frags every second.
timer.Create(tostring(PLUGIN), 1, 0, function()
for k, v in pairs( player.GetAll() ) do
if ( !v:IsAdmin() ) then
local frags = 9000;
local uniqueID = v:UniqueID();

		-- Check if the player's frags table.
		if ( PLUGIN.frags[uniqueID] and CurTime() > PLUGIN.frags[uniqueID] ) then
			PLUGIN.frags[uniqueID] = CurTime() + 3600;
			
			-- Set the player's kill reset time so that we can get it client side.
			cider.player.setLocalPlayerVariable( v, CLASS_LONG, "_KillResetTime", PLUGIN.frags[uniqueID] );
			
			-- Reset the player's frags.
			v:SetFrags(0);
		else
			if (v.cider._Donator > 0) then frags = frags + 4; end;
			
			-- Check if the player has reached their maximum frags.
			if (v:Frags() > frags) then
				v:SetFrags(0);
				
				-- Set the player's frags table to nil.
				PLUGIN.frags[uniqueID] = nil;
				
				-- Check if Citrus is installed.
				if (citrus) then
					citrus.Bans.Add(v, nil, 172800, "Maximum Kills", true);
				else
					game.ConsoleCommand("banid 120 "..v:SteamID().."

");
game.ConsoleCommand("kickid “…v:SteamID()…” 2880 Hour Ban (Maximum Kills)
");
end;
end;
end;
end;
end;
end);

– Register the plugin.
cider.plugin.register(PLUGIN);
[/lua]

sh_init.lua
[lua]
–[[
Name: “sh_init.lua”.
Product: “Cider (Roleplay)”.
–]]

local PLUGIN = PLUGIN_SHARED;

– Set some information for the plugin.
PLUGIN.name = “Ban Frags”;
PLUGIN.author = “********”;
[/lua]

cl_init.lua
[lua]
–[[
Name: “cl_init.lua”.
Product: “Cider (Roleplay)”.
–]]

local PLUGIN = {};

– Create a variable to store the plugin for the shared file.
PLUGIN_SHARED = PLUGIN;

– Include the shared file.
include(“sh_init.lua”);

– Called when the top text should be drawn.
cider.hook.add(“DrawTopText”, function(text)
local frags = 8000;

-- Check if the player is an administrator.
if ( LocalPlayer():IsAdmin() ) then return; end;

-- Check if the player has Donator status.
if ( LocalPlayer():GetNetworkedBool("cider_Donator") ) then frags = frags + 4; end;

-- Check if the player is not warranted.
if (LocalPlayer():GetNetworkedString("cider_Warranted") != "arrest") then
	if (LocalPlayer():Frags() >= 1) then
		if (LocalPlayer():Frags() >= frags) then
			local seconds = math.floor( (LocalPlayer()._KillResetTime or 0) - CurTime() );
			
			-- Check if the amount of seconds is greater than 60.
			if (seconds > 60) then
				text.y = GAMEMODE:DrawInformation("You have reached maximum kills until "..math.ceil(seconds / 60).." minute(s).", "ChatFont", text.x, text.y, Color(255, 150, 75, 255), 255, true, function(x, y, width, height)
					return x - width - 8, y;
				end);
			else
				text.y = GAMEMODE:DrawInformation("You have reached maximum kills until "..seconds.." second(s).", "ChatFont", text.x, text.y, Color(255, 150, 75, 255), 255, true, function(x, y, width, height)
					return x - width - 8, y;
				end);
			end;
		elseif ( LocalPlayer():Frags() >= (frags - 4) ) then
			text.y = GAMEMODE:DrawInformation("You have reached "..LocalPlayer():Frags().."/"..frags.." kills for this hour.", "ChatFont", text.x, text.y, Color(255, 150, 75, 255), 255, true, function(x, y, width, height)
				return x - width - 8, y;
			end);
		end;
	end;
else
	text.y = GAMEMODE:DrawInformation("You may kill the police and City Administrator.", "ChatFont", text.x, text.y, Color(255, 150, 75, 255), 255, true, function(x, y, width, height)
		return x - width - 8, y;
	end);
end;

end);

– Register the plugin.
cider.plugin.register(PLUGIN);
[/lua]

I recommend changing player to ply wherever you do not intend to use the player class

stop using so many admin mods then.

simple as fuck

It’s not being caused by that plugin. Something you have done to Cider has broken it.
Why do you even have it if it sets your frag limit to 9000?

I only use ULX and ULIB… <- That is 1 admin mod.

I set it to 9000 because than I’m sure people don’t get banned when they are playing like 4 hour and try to defending the contraband. Without RDM ofcourse ^^ Can I also just delete the folder?

You realise that the timer resets your frags every hour, right?
But yes, you can simply delete the plugin folder if you don’t want a frag limit.

Ok deleted, I will run the server now and when it’s bugged again I paste log.

It’s still broken, you haven’t fixed it by deleting that plugin. You need to look at all the bits you’ve modified yourself.

Ok cider and admin crashed again, the banfrags errors are gone but now it’s spamming this:

[lua]
L 09/13/2009 - 11:49:52: Lua Error: ERROR: Hook ‘FPP_ShowOwner’ Failed: autorun/server/FPP_core.lua:160: attempt to call field ‘GetAll’ (a nil value)
L 09/13/2009 - 11:49:52: Lua Error: Removing Hook ‘FPP_ShowOwner’
L 09/13/2009 - 11:49:54: Lua Error: Timer Error: ULib/server/util.lua:120: attempt to call field ‘GetAll’ (a nil value)
L 09/13/2009 - 11:49:57: Lua Error: Timer Error: ULib/server/util.lua:120: attempt to call field ‘GetAll’ (a nil value)
L 09/13/2009 - 11:50:00: Lua Error: Timer Error: ULib/server/util.lua:120: attempt to call field ‘GetAll’ (a nil value)
L 09/13/2009 - 11:50:03: Lua Error: Timer Error: ULib/server/util.lua:120: attempt to call field ‘GetAll’ (a nil value)
L 09/13/2009 - 11:50:06: Lua Error: Timer Error: ULib/server/util.lua:120: attempt to call field ‘GetAll’ (a nil value)
L 09/13/2009 - 11:50:09: Lua Error: Timer Error: ULib/server/util.lua:120: attempt to call field ‘GetAll’ (a nil value)
L 09/13/2009 - 11:50:12: Lua Error: Timer Error: ULib/server/util.lua:120: attempt to call field ‘GetAll’ (a nil value)
L 09/13/2009 - 11:50:15: Lua Error: Timer Error: ULib/server/util.lua:120: attempt to call field ‘GetAll’ (a nil value)
L 09/13/2009 - 11:50:18: Lua Error: ERROR: Hook ‘ULXLogVehicleSpawn’ Failed: ulx\log.lua:222: attempt to call field ‘GetAll’ (a nil value)
L 09/13/2009 - 11:50:18: Lua Error: Removing Hook ‘ULXLogVehicleSpawn’
[/lua]

Maybe it crashed because someone joins with a bugged cider gamemode?


It crashes because *you* have done something wrong somewhere in the code that *you* have modified.

You have overwritten the player table somewhere. Find it.

Searched for 2 hours now, but I have no clue what I did wrong. :frowning:

You overwrote the global ‘player’ table with a player.