21.02.2014, 23:38
(
Последний раз редактировалось Aerotactics; 22.02.2014 в 01:48.
)
After doing several searches and coming up empty, I have a problem in this script. It's not my script, so I don't know how to fix it:
EDIT: RESOLVED! hspawns needs to float: "Float:hspawns..."
pawn Код:
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]);
}