local tableVehicle = {}
function serverSpawn(selectedList1,playerxyz)
local x, y, z = getElementPosition ( playerxyz )
local rx,ry,rz = getElementRotation(playerxyz)
if ( isPedInVehicle (playerxyz) ) then
outputChatBox( "[Error] Exit your current vehicle first.", playerxyz, 255, 0, 0, true )
else
if ( tableVehicle[playerxyz] ) then
destroyElement ( tableVehicle[playerxyz] )
tableVehicle[playerxyz] = nil
end
local playerVehicle = createVehicle ( selectedList1, x+1, y+1, z+0.5, rx,ry,rz )
warpPedIntoVehicle ( playerxyz, playerVehicle )
tableVehicle[playerxyz] = playerVehicle
end
end
addEvent("spawncar",true)
addEventHandler("spawncar",getRootElement(),serverSpawn)
hm, try this...