Nearest Hospital Spawn Upon Death
#6

Just do this, simple.

Somewhere in your code:
PHP код:
   #define MAX_HOSPITALS 8
    
static const Float:hspawns[MAX_HOSPITALS][4] = 
    {
                {
2027.77, -1420.5215.99137.0},
        {
1180.85, -1325.5712.58271.4},
        {
1244.437331.226118.55477.5465},
        {-
2199.719, -2308.07529.6181322.8928},
        {-
2670.285616.436413.4531183.1042},
        {-
316.38321056.04518.73441.6017},
        {-
1514.8232527.11954.74432.3546},
        {
1578.4461770.6829.835899.7567}
       
    }; 
OnPlayerDeath:
PHP код:
new Float:distance 99999.0,
        
Float:tmp_distance
        
closest = -1;
    for(new 
0MAX_HOSPITALSi++)
    {
        
tmp_distance GetPlayerDistanceFromPoint(playeridhspawnsr[i][0], hspawns[i][1], hspawns[i][2]);
        if (
tmp_distance distance)
        {
            
distance tmp_distance;
            
closest i;
        }
    }
    
SetSpawnInfo(playeridNO_TEAMGetPlayerSkin(playerid), hspawns[closest][0],hspawns[closest][1],hspawns[closest][2],hspawns[closest][3], 000000); 
Should Work!
Reply


Messages In This Thread
Nearest Hospital Spawn Upon Death - by marley - 17.07.2016, 00:18
Re: Nearest Hospital Spawn Upon Death - by DTV - 17.07.2016, 01:11
Re: Nearest Hospital Spawn Upon Death - by marley - 17.07.2016, 02:29
Re: Nearest Hospital Spawn Upon Death - by DTV - 17.07.2016, 03:08
Re: Nearest Hospital Spawn Upon Death - by [cS]Owain - 17.07.2016, 05:17
Re: Nearest Hospital Spawn Upon Death - by oMa37 - 17.07.2016, 05:34
Re: Nearest Hospital Spawn Upon Death - by marley - 17.07.2016, 17:43

Forum Jump:


Users browsing this thread: 1 Guest(s)