VenomOG Posted April 22, 2018 Share Posted April 22, 2018 Help I want when a cop dies a d if there in lv,sf,L's they spawn at a police department can anyone start me off? Link to comment
DNL291 Posted April 22, 2018 Share Posted April 22, 2018 onPlayerWasted getZoneName (enable the 4th argument "citiesonly") For the spawn locations, I recommend using a table with cities as key with their respective coordinates. Link to comment
VenomOG Posted April 23, 2018 Author Share Posted April 23, 2018 dEventHandler( "onPlayerWasted", getRootElement( ), function() if isPlayerInTeam(player, "SAPD") then setTimer( spawnPlayer, 2000, 1, source, 0, 0, 3 ) local location = getZoneName ( x, y, z ) end ) New to lua so Link to comment
DNL291 Posted April 23, 2018 Share Posted April 23, 2018 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
VenomOG Posted April 23, 2018 Author Share Posted April 23, 2018 Okay, Thanks if i did Spoiler local copTeams = { ["Government"] ["Law Enforcement"] how can i make the script check for tose teams when player dies Link to comment
DNL291 Posted April 23, 2018 Share Posted April 23, 2018 local copTeams = { ["Government"] = true, ["Law Enforcement"] = true } local team = getPlayerTeam(player) if copTeams[getTeamName(team)] then end Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now