Useing the debugger, No Errors are picked up upon entering the 2nd Marker. Nothing happense. Not a single thing.
Another thing is that it's posting the blips for all players.
Here is the New code:
function sendMessageOnPizzaStart ( player, seat, jacked)
if ( getVehicleID ( source ) == 448 ) then
outputChatBox ( "Press F2 to Begin Pizza Delivery" , player)
bindKey ( player, "F2", "down", pizzaDeliveryHandler)
end
end
function pizzaDeliveryHandler ( source, key, keystate )
pbplace = createBlip (-1807.4569,944.3589,24.8906, 29,2,255,0,0,255,0, source )
pplace = createMarker ( -1807.4569,944.3589,24.8906, "cylinder", 3,240,0,0,200, source )
outputChatBox ( "Pickup the Pizza from the Pizza Blip on the Radar" , source )
end
function onMarkerHitHandler ( player, matchingDimension )
outputChatBox( "onMarkerHitHandler", player )
if source == pplace then
outputChatBox( "onMarkerHitHandler - pplace", player )
destroyElement ( pbplace )
destroyElement ( pplace )
pbcustomer = createBlip ( -2710.8235,969.6843,54.4609, 29,2,255,0,0,255,0,player )
pcustomer = createMarker ( -2710.8235,969.6843,54.4609, "cylinder", 3,240,0,0,200,player )
outputChatBox ( "You have the Pizza, Now proceed to the customer", player ) -- send it to player only
elseif source == pcustomer then
outputChatBox( "onMarkerHitHandler - pcustomer", player )
destroyElement ( pbcustomer )
destroyElement ( pcustomer )
outputChatBox ( "You have successfully delivered the Pizza, Here is your Money", player ) -- send it to that player only
givePlayerMoney ( player, 25 )
end
end
-- Event Handlers
addEventHandler ( "onVehicleEnter", getRootElement(), sendMessageOnPizzaStart )
addEventHandler ( "onMarkerHit", getRootElement (), onMarkerHitHandler )