Lua Basics: Learn the Lua programming language (Lua Tutorial).
MTA Wiki: Explore the functions on the MTA Scripting Wiki.
Sample Code: A simple vehicle spawning script:
lua
function spawnVehicle(player, command, vehicleID)
local x, y, z = getElementPosition(player)
createVehicle(tonumber(vehicleID), x, y, z)
outputChatBox("Vehicle spawned!", player)
end
addCommandHandler("vehicle", spawnVehicle)
Test: Test your script on the local server.