Jump to content

Help spawn police


VenomOG

Recommended Posts

  • Moderators

Something like this:

local copSpawnLocs = {
	["Los Santos"] = { x, y, z, rot },
	["Las venturas"] = { x, y, z, rot },
	["San fierro"] = { x, y, z, rot }
}
addEventHandler( "onPlayerWasted", getRootElement( ),
	function()
		if getPlayerTeam(source) and getPlayerTeam(source) == "SAPD" then
			local px,py = getElementPosition(source)
			local tpos = copSpawnLocs[ getZoneName( px, py, 0, true ) ]
			if tpos then
				setTimer( function(player)
					local sx, sy, sz, srot = unpack(tpos)
					spawnPlayer( player, sx, sy, sz, srot )
				end, 2000, 1, source )
			end
		end
	end
)

And of course, you need edit the table with all the cities of San Andreas and the spawn coordinates.

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...