Ergebnis 1 bis 6 von 6

Thema: Server-Crash bei mapchange

  1. #1
    Avatar von Northdegree
    Registriert seit
    19.03.2012
    Ort
    Schleswig-Holstein

    Standard Server-Crash bei mapchange

    Hallo liebe Leute,

    komischerweise crasht mein Server sobald ich einen Mapchange mache. Jedoch läuft der Server normal wenn ich die map via. startkommando starte.

    Ich habe den (Problem)-code schon ausfindig gemacht.

    Lua Code:
    1. function ReFuel()
    2. 	if GasOnline then
    3. 		for i,ent in pairs (vehicle_table) do
    4. 			local Vehicle = ent
    5. 			if not (Vehicle and Vehicle:IsValid() and Vehicle:IsVehicle()) then return end
    6. 			local ply = Vehicle:GetDriver()
    7. 			if ply:IsValid() and ply:IsPlayer() then
    8. 				local Fuel = Vehicle:GetNWInt("fuel")
    9. 				local price = 2
    10. 				local plypos = ply:GetPos()
    11. 				local plyposx = math.Round(plypos.x) 
    12. 				local plyposy = math.Round(plypos.y) 
    13. 				if (plyposx <= tankx1 and plyposx >= tankx2) or (plyposx <= tankx3 and plyposx >= tankx4) then
    14. 				--print("x-coordinate matches")
    15. 					if (plyposy <= tanky1 and plyposy >= tanky2) or (plyposy <= tanky3 and plyposy >= tanky4) then
    16. 					--print("y-coordinate matches")
    17. 						if Fuel <= 0 and ply:CanAfford(3*price) then
    18. 							Vehicle:Fire("turnon", 1, 0)
    19. 						end
    20. 						if Fuel <= 97 then
    21. 							if not ply:CanAfford(3*price) then Notify(ply, 1, 4, string.format(LANGUAGE.cant_afford, "fuel")) return "" end
    22. 							ply:AddMoney(-(3*price))
    23. 							local newfuel = Fuel + 3
    24. 							Vehicle:SetNWInt("fuel", newfuel)
    25. 						elseif Fuel == 98 then
    26. 							if not ply:CanAfford(2*price) then Notify(ply, 1, 4, string.format(LANGUAGE.cant_afford, "fuel")) return "" end
    27. 							ply:AddMoney(-(2*price))
    28. 							local newfuel = Fuel + 2
    29. 							Vehicle:SetNWInt("fuel", newfuel)	
    30. 						elseif Fuel == 99 then
    31. 							if not ply:CanAfford(price) then Notify(ply, 1, 4, string.format(LANGUAGE.cant_afford, "fuel")) return "" end
    32. 							ply:AddMoney(-price)
    33. 							local newfuel = Fuel + 1
    34. 							Vehicle:SetNWInt("fuel", newfuel)	
    35. 						elseif Fuel >= 100 then
    36. 						return
    37. 						end
    38. 					end
    39. 				end
    40. 			end
    41. 		end
    42. 	end
    43. end
    44. timer.Create("Vehicle_Fuel_CountUp", 3, 0, ReFuel)
    45. function CountFuels()
    46. 	if GasOnline then
    47. 		for i,ent in pairs (vehicle_table) do
    48. 			local conv = 10.936133
    49. 			local Vehicle = ent
    50. 			if not (Vehicle and Vehicle:IsValid() and Vehicle:IsVehicle()) then return end
    51. 			local speed = Vehicle:GetVelocity():Length()/conv
    52. 			local Fuel = Vehicle:GetNWInt("fuel")
    53. 			if Fuel > 0 and Vehicle:GetDriver() then
    54. 				if speed > 2 and speed < 50 then
    55. 					local newfuel = Fuel - 1
    56. 					Vehicle:SetNWInt("fuel", newfuel)
    57. 				elseif speed > 49 then
    58. 					local newfuel = Fuel - 2
    59. 					Vehicle:SetNWInt("fuel", newfuel)
    60. 				end
    61. 			elseif Fuel < 0 then
    62. 				Vehicle:SetNWInt("fuel", 0)
    63. 			end
    64. 			if Vehicle:GetNWInt("fuel") < 1 then
    65. 				Vehicle:Fire("turnoff", 1, 0)
    66. 				local Driver = Vehicle:GetDriver()
    67. 				if Driver and Driver:IsValid() and Driver:IsPlayer() then
    68. 					Notify(Driver, 1, 5, "This vehicle ran out of fuel!")
    69. 				end
    70. 			end
    71. 		end
    72. 	end
    73. end
    74. timer.Create("Vehicle_Fuel_Count", 20, 0, CountFuels)

    Kann mir vielleicht jemand sagen, warum genau dieser Code den Mapchange blockiert?

    Mit freundlichen Gruß:
    Northdegree

  2. #2

    Standard AW: Server-Crash bei mapchange

    Gibt's bei/nach dem Crash möglicherweise irgendeine genauere Problembeschreibung?

  3. #3
    Avatar von Northdegree
    Registriert seit
    19.03.2012
    Ort
    Schleswig-Holstein

    Standard AW: Server-Crash bei mapchange

    Nein, der schmiert ohne dump oder sonstiges ab.

  4. #4
    Horst Avatar von minifisch
    Registriert seit
    02.09.2008
    Ort
    Österreich

    Standard AW: Server-Crash bei mapchange

    Guck mal in den Logs nach einer Fehlermeldung kurz vor dem Crash
    Gruß
    minifisch

  5. #5

    Standard AW: Server-Crash bei mapchange

    der kack ist ja der, dass SRCDS und die addons immer erst loggen.. und minuten später crasht der server

    Schmiert der code auch im Singleplayer ab?
    denn da macht der ggf eine dump

  6. #6
    Avatar von Northdegree
    Registriert seit
    19.03.2012
    Ort
    Schleswig-Holstein

    Standard AW: Server-Crash bei mapchange

    Also das letzte was ich in der Log sehe ist "ScriptEnforce is disabled".

    Im Singleplayer genau das selbe. Sobald ich einen Mapchange mache crasht der Server.

    Das passiert aber erst nach dem einfügen des genannten codes. Sobald ich diesen auskommentiere funktioniert es einwandfrei.

    Aber wenn ich den Server normal starte (ohne einen Mapchange) läuft es ohne Probleme.

Ähnliche Themen

  1. Multiplayer Server Crash
    Von timeswitch im Forum Hilfe & Support
    Antworten: 2
    Letzter Beitrag: 11.07.2010, 12:35
  2. Server Crash
    Von Lunara im Forum Server
    Antworten: 2
    Letzter Beitrag: 31.07.2009, 10:24
  3. Komische meldung bei server crash
    Von Blaze im Forum Server
    Antworten: 8
    Letzter Beitrag: 14.04.2009, 19:56
  4. Garrys Mod 10(11) Server Crash
    Von DigitalDeath im Forum Server
    Antworten: 4
    Letzter Beitrag: 27.02.2009, 12:20
  5. Server Start = crash
    Von gamerpaddy im Forum Server
    Antworten: 0
    Letzter Beitrag: 09.05.2008, 07:05

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •