Jump to content

¿Segmentation Fault (Core Dumped)?


Recommended Posts

Buen día, recientemente he estado fabricando un script que básicamente es un remake del "Briefcase Race" del propio MTA-SA, pero como un evento ocasional en un servidor. El script funciona completamente normal, sin embargo, cuando ocurre un evento en especifico (robarle el maletín al usuario), el servidor crashea, tanto en el host como en el servidor local.

El error que aparece (en el host) es el siguiente:

/entrypoint.sh: line 13: 13 segmentation fault (core dumped) ./mta-server64 --port ${SERVER_PORT} --httpport ${SERVER_WEBPORT} -n

En mi servidor local no muestra ningún error, solo se cierra la consola y ya.

La función en cuestión que se ejecuta cuando el servidor crashea, es la siguiente:

local function steal(p)
	if ( p ) and ( isElement(p) ) then
		if ( getElementType(p) == "player" ) then
			if ( p ~= BRIEF_HOLDER ) then
				detachElements(BRIEF_ELEMENT, BRIEF_HOLDER); attachElements(BRIEF_ELEMENT, p)
        		---
				setElementData(BRIEF_HOLDER, "haveBriefcase", false)
				BRIEF_HOLDER = p; setElementData(BRIEF_HOLDER, "haveBriefcase", true)
				---
			end
		end
	end
end

ANOTACIONES:

  1. "BRIEF_HOLDER"  es la variable que contiene al jugador que en ese momento sea el portador del maletín.
  2. "BRIEF_ELEMENT"  es un ColSphere, que tiene attachado a su vez un marker y un blip

Cuando se ejecuta dicha función, ocurre el crasheo del servidor.

¿Qué podría ser? ¿Un problema con los attach o algo así?

Agradecido de antemano por el tiempo.

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...