Unexpected symbol near then?

I want to do a simple command to spawn a ped and a vehicle, but I get this error: Unexpected symbol near ‘then’
I don’t understand, can someone tell me the error? I leave my simple code here. Thanks!!
r.lua (1.5 KB)

Assuming it’s line 17 it looks like your missing an if statement

so you have

CreatePed(CIVMALE, ‘a_m_m_acult_01’, GetEntityCoords(ped, true), GetEntityHeading(ped), true, false) then
spawn_vehicle()
end

but I would expect it to be

if CreatePed(CIVMALE, ‘a_m_m_acult_01’, GetEntityCoords(ped, true), GetEntityHeading(ped), true, false) then
spawn_vehicle()
end