MR.S3D Posted January 6, 2012 Share Posted January 6, 2012 hi guys this my code server side local marker1 = createMarker(1525.3000488281,2834.3999023438,23.39999961853,"checkpoint",20,255,255,255,255) function marker(player) if (source == marker1) then local players = getElementsByType ( "player" ) timer = setTimer (function (player) if isPedInVehicle(player) then local veh = getPedOccupiedVehicle(player) if veh then destroyElement(veh) end end end ,1000,0, player) end end addEventHandler ("onMarkerHit",getRootElement(),marker) addEventHandler ("onMarkerLeave",getRootElement(),function() if (source == marker1) then if isTimer(timer) then killTimer(timer) end end end) this work onMarkerHit but when i leave the marker my Vehicle destroyed agin why ? please some one help me Link to comment
Xeno Posted January 6, 2012 Share Posted January 6, 2012 local marker1 = createMarker(1525.3000488281,2834.3999023438,23.39999961853,"checkpoint",20,255,255,255,255) function marker(player) if (source == marker1) then local players = getElementsByType ( "player" ) timer = setTimer (function (player) if isPedInVehicle(player) then local veh = getPedOccupiedVehicle(player) end end end ,1000,0, player) end end addEventHandler ("onMarkerHit",getRootElement(),marker) addEventHandler ("onMarkerLeave",getRootElement(),function() if (source == marker1) then if isTimer(timer) then killTimer(timer) end end end) Link to comment
MR.S3D Posted January 6, 2012 Author Share Posted January 6, 2012 local marker1 = createMarker(1525.3000488281,2834.3999023438,23.39999961853,"checkpoint",20,255,255,255,255) function marker(player) if (source == marker1) then local players = getElementsByType ( "player" ) timer = setTimer (function (player) if isPedInVehicle(player) then local veh = getPedOccupiedVehicle(player) end end end ,1000,0, player) end end addEventHandler ("onMarkerHit",getRootElement(),marker) addEventHandler ("onMarkerLeave",getRootElement(),function() if (source == marker1) then if isTimer(timer) then killTimer(timer) end end end) not work Link to comment
Castillo Posted January 6, 2012 Share Posted January 6, 2012 local marker1 = createMarker(1525.3000488281,2834.3999023438,23.39999961853,"checkpoint",20,255,255,255,255) local timers = {} function marker(player) if (source == marker1) then timers[player] = setTimer (function (player) if isPedInVehicle(player) then local veh = getPedOccupiedVehicle(player) if veh then destroyElement(veh) end end end, 1000, 0, player) end end addEventHandler ("onMarkerHit",getRootElement(),marker) addEventHandler ("onMarkerLeave",getRootElement(),function(player) if (source == marker1) then if isTimer(timers[player]) then killTimer(timers[player]) end end end) Link to comment
MR.S3D Posted January 6, 2012 Author Share Posted January 6, 2012 Solidsnake14 this work thanks you so much Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now