Spawn in the same area were you died?
#7

Quote:
Originally Posted by Roko_foko
Посмотреть сообщение
Yea, you can try what person above said, but I don't know where you want to spawn person? at hospital, some point you specified before?

In my first response, I thouhgt you want to spawn at exact location where person died.
In case you have points where you would like to spawn. And on player's death get the closest one:
Код:
new Float:distance; 
new respawnID;

distance = GetPlayerDistanceFromPoint(playerid, respawnPoints[0][0], respawnPoints[0][1], respawnPoints[0][2]);
respawnID = 0;
for(new i = 1; i < MAX_RESPAWN_POINTS; ++i) 
{
    new tempDistance = GetPlayerDistanceFromPoint(playerid, respawnPoints[i][0], respawnPoints[i][1], respawnPoints[i][2]);
    if(tempDistance < distance) 
    {
        distance = tempDistance;
        respawnID = i;
    }
}
// and after this loop your coordinates you need are stored inside respawnPoints[respawnID]
This is were i was looking for
Reply


Messages In This Thread
Spawn in the same area were you died? - by Cheesus - 30.06.2015, 08:40
Re: Spawn in the same area were you died? - by Roko_foko - 30.06.2015, 08:58
Re: Spawn in the same area were you died? - by Cheesus - 30.06.2015, 09:05
Re: Spawn in the same area were you died? - by Hessu - 30.06.2015, 09:14
Re: Spawn in the same area were you died? - by Cheesus - 30.06.2015, 09:17
Re: Spawn in the same area were you died? - by Roko_foko - 30.06.2015, 09:26
Re: Spawn in the same area were you died? - by Cheesus - 30.06.2015, 09:31
Re: Spawn in the same area were you died? - by Roko_foko - 30.06.2015, 09:44

Forum Jump:


Users browsing this thread: 1 Guest(s)