Its your bug you should use seat (thirs function argument)
x,y,z = getElementPosition(getRandomPlayer()) -- i'm alone at the server , so it's should get me
veh = createVehicle(411,x,y,z) -- creating the vehicle
ped = createPed(211,x,y,z) -- creating the ped
warpPedIntoVehicle(ped,veh, 1) -- Warping Ped into the Vehicle
addEventHandler("onVehicleStartEnter",root,function() outputChatBox("You are trying to enter a vehicle !") end) -- This event won't get called !