View Issue Details

IDProjectCategoryView StatusLast Update
0001625Multi Theft Auto : San AndreasScriptingpublic2006-10-25 18:48
Reportererorr404Assigned ToJax 
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Versionblue_sa.r2.a12 
Target VersionFixed in Versionmtasadm_v1.0-dp1 
Summary0001625: Another server crash
Description

This occured in my ctf script (ctflarge_er.map, ctf_er.lua), after I picked up the flag (onFlagHit) and died (onTargetWasted) a second later. Could it be from adding event handlers and removing them shortly afteward?

Additional Information

function onFlagHit ( player, matching_dimension )
if ( isPlayerDead ( player ) == false and getElementData ( player, "pickup" ) == true ) then
if ( isPlayerInVehicle ( player ) == false or getElementData ( source, "state" ) == 2 ) then
if ( droptimer ) then
killTimer ( droptimer )
droptimer = false
end
removeEventHandler ( "onMarkerHit", source, "onFlagHit" )
destroyBlipAttachedTo ( source )
destroyElement ( source )
destroyBlipAttachedTo ( player )
addEventHandler ( "onPlayerWasted", player, "onTargetWasted" )
addEventHandler ( "onPlayerEnterVehicle", player, "onTargetEnterVehicle" )
addEventHandler ( "onPlayerExitVehicle", player, "onTargetExitVehicle" )
addEventHandler ( "onPlayerQuit", player, "onTargetQuit" )
local vehicle = getPlayerOccupiedVehicle ( player )
if ( vehicle ) then
addEventHandler ( "onVehicleDamage", vehicle, "onTargetVehicleDamage" )
end
createBlipAttachedTo ( player, 0, 2, 255, 255, 0, 255 )
setElementData ( player, "points", tostring ( getElementData ( player, "points" ) + 25 ) )
setElementData ( player, "pickup", false )
if ( tonumber ( getElementData ( player, "points" ) ) >= 1000 ) then
setText ( "Point limit reached, " .. getClientName ( player ) .. " wins!", 5000 )
setTimer ( "killPlayersAndShowScores", 5000, 1 )
setTimer ( "endMap", 10000, 1 )
else
setText ( getClientName ( player ) .. " has the flag!", 5000 )
end
end
end
end

function onTargetWasted ( ammo, killer, weapon, bodypart )
removeEventHandler ( "onPlayerWasted", source, "onTargetWasted" )
removeEventHandler ( "onPlayerEnterVehicle", source, "onTargetEnterVehicle" )
removeEventHandler ( "onPlayerExitVehicle", source, "onTargetExitVehicle" )
removeEventHandler ( "onPlayerQuit", source, "onTargetQuit" )
local vehicle = getPlayerOccupiedVehicle ( source )
if ( vehicle ) then
removeEventHandler ( "onVehicleDamage", vehicle, "onTargetVehicleDamage" )
end
setElementData ( source, "pickup", true )
setText ( getClientName ( source ) .. " dropped the flag!", 5000 )
local x, y, z = getElementPosition ( source )
local flag = setFlagMarker ( 1, x, y, z )
droptimer = setTimer ( "resetFlag", 300000, 1, flag )
end

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change