stock SpawnToHospital(playerid)
{
dead[playerid] = 0;
static const hspawns[][4] =
{
{2034.1670,-1406.0623,17.2181, 150.4297}, //tag mismatch
{1177.3391,-1324.2300,14.0658,268.3749} //tag mismatch
};
new Float:spawndist[2]; // Change to the number of hospital spawnpoints you use.
new Float:distance = 10000.0, closestspawn;
spawndist[0] = GetPlayerDistanceFromPoint(playerid, 2034.1670,-1406.0623,17.2181);
spawndist[1] = GetPlayerDistanceFromPoint(playerid, 1177.3391,-1324.2300,14.0658);
for(new i = 0; i < sizeof(spawndist); i++)
{
if(spawndist[i] < distance) distance = spawndist[i], closestspawn = i;
}
SetPlayerPos(playerid, hspawns[closestspawn][0], hspawns[closestspawn][1], hspawns[closestspawn][2]);
SetPlayerFacingAngle(playerid, hspawns[closestspawn][3]);
}
{-1406.0623,17.2181, 150.4297}, {-1324.2300,14.0658,268.3749}
It seems like you placed the wrong coordinates.
it should be liike this Код:
{-1406.0623,17.2181, 150.4297}, {-1324.2300,14.0658,268.3749} |