View Issue Details

IDProjectCategoryView StatusLast Update
0002551Multi Theft Auto : San AndreasScriptingpublic2007-11-11 20:46
ReporterjbetaAssigned ToeAi 
Status resolvedResolutionfixed 
PlatformAMD Athlon(tm) 64 X2 ~2.2GHzOSWindows XP Professional x64 SP1OS Version5.2, Build 3790
Product Versionblue_sa.r2.a12 
Target VersionFixed in Versionmtasadm_v1.0-dp1 
Summary0002551: Clientside event handlers are not always added after restarting

When restarting a resource that adds clientside event handlers, an error message from addEventHandler shows saying that the event is already handled.

This does not happen when stopping, then starting. Restarting again after this issue has happened causes the script to reload adding the handlers as expected.

Steps To Reproduce

(only on test servers)
/start mantis2551
/restart mantis2551


/start runcode
/start mantis2551
/run restartResource(getResourceFromName "mantis2551")

Check debug. Every two restarts, you'll get a message saying rtEvent is already handled.

Additional Information


function handler()
outputChatBox "restarttest handler triggered!"
addEvent "rtEvent"
addEventHandler("rtEvent", getRootElement(), handler)

TagsNo tags attached.


related to 0002573 resolvedkevuwk startResource() and restartResource() only update modified client files one out of two times 
related to 0002506 closed Issues with starting updated client scripts and stop/start/restarting client scripts in general 0x0C746D3C & 0x0BF46D3C 



2007-10-04 20:36

updater   ~~0005914

This only happens when using the /restart command and restartResource(). It is not an issue when using /start then /stop (or startResource() then stopResource()).


2007-10-13 13:32

updater   ~~0005966

I'd also add that it only happens when the script is left unchanged, it never happens when you update it before restarting


2007-11-11 20:46

administrator   ~~0006223

Last edited: 2007-11-11 20:47

Fixed, happened when the stop and start packets arrived in the same frame, the old event handler was still being deleted so the new event handler couldn't be added.

Issue History

Date Modified Username Field Change