script.lua
function createVehicleForPlayer(thePlayer, command, vehicleModel)
local x,y,z = getElementPosition(thePlayer)
x = x + 5
local createdVehicle = createVehicle(tonumber(vehicleModel),x,y,z)
if (createdVehicle == false) then
outputChatBox("Failed to create vehicle.",thePlayer)
end
end
addCommandHandler("cg", createVehicleForPlayer)
meta.xml
"Wiki" type="script" name="onplayerjoin" description="Spawn Vehicle" />
Test ke liye time nahi tha, lekin ye inshallah work kari ge. btw, wiki ko bhi consult kiya karo.
EDIT: Credit goes to wiki.