Jump to content

I need help.


Viudes

Recommended Posts

say always error "stack overflow" How i can fix this?

 


function spawnVehicle(x,y,z,VehicleName)
id = getVehicleModelFromName(VehicleName)
spawnVeh = spawnVehicle (id, -2322.58496, -1622.78491, 483.70908)
end

addEvent("onSpawnVehicle", true)
addEventHandler("onSpawnVehicle",getRootElement(),spawnVehicle)

 

Link to comment
function spawnVehicleF(x,y,z,VehicleName)
	id = getVehicleModelFromName(VehicleName)
	spawnVeh = spawnVehicle(id, -2322.58496, -1622.78491, 483.70908)
end
addEvent("onSpawnVehicle", true)
addEventHandler("onSpawnVehicle",getRootElement(),spawnVehicleF)

You can't name the function the same as you'd call the default MTA function or it'll recreate it.

  • Like 1
Link to comment
  • Administrators
function mySpawnVehicle(x,y,z,VehicleName)
  id = getVehicleModelFromName(VehicleName)
  spawnVeh = spawnVehicle (id, -2322.58496, -1622.78491, 483.70908)
end
addEvent("onSpawnVehicle", true)
addEventHandler("onSpawnVehicle",getRootElement(),mySpawnVehicle)

Don't overwrite function names unless you know what you are doing.

  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...