PHP код:
new Float:gHospitalLocations[][4] = {
{-2660.9519,630.8198,14.4531,179.2536},
{-2207.3352,-2285.7437,30.6250,328.3635},
{2027.5869,-1421.5159,16.9922,134.5767},
{1183.1479,-1323.4757,13.5776,270.0348},
{-319.3146,1059.4440,19.7422,322.3916},
{-1514.5492,2527.2280,55.7423,348.1437},
{1576.8633,1768.6094,10.6719,87.9024},
};
GetClosestHospital(playerid)
{
new closest = -1;
for(new i, Float:minDist = Float:0x7F800000; i < sizeof(gHospitalLocations); i++)
{
new Float:currentDist = GetPlayerDistanceFromPoint(playerid, gHospitalLocations[i][0], gHospitalLocations[i][1], gHospitalLocations[i][2]);
if(currentDist < minDist)
{
minDist = currentDist;
closest = i;
}
}
return closest;
}
public OnPlayerDeath(playerid, killerid, reason)
{
new
h_id = GetClosestHospital(playerid);
new
Float:x = gHospitalLocations[h_id][0],
Float:y = gHospitalLocations[h_id][1],
Float:z = gHospitalLocations[h_id][2],
Float:a = gHospitalLocations[h_id][3];
SetSpawnInfo(playerid, ..., -2660.9519,630.8198,14.4531,179.2536, ...);
SetSpawnInfo(playerid, ..., -2207.3352,-2285.7437,30.6250,328.3635, ...);
SetSpawnInfo(playerid, ..., 2027.5869,-1421.5159,16.9922,134.5767, ...);
SetSpawnInfo(playerid, ..., 1183.1479,-1323.4757,13.5776,270.0348, ...);
SetSpawnInfo(playerid, ..., -319.3146,1059.4440,19.7422,322.3916, ...);
SetSpawnInfo(playerid, ..., -1514.5492,2527.2280,55.7423,348.1437, ...);
SetSpawnInfo(playerid, ..., 1576.8633,1768.6094,10.6719,87.9024, ...);
return 1;
}
Errors ..
Код:
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(224) : error 029: invalid expression, assumed zero
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(224) : error 008: must be a constant expression; assumed zero
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(255) : error 029: invalid expression, assumed zero
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(256) : error 029: invalid expression, assumed zero
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(257) : error 029: invalid expression, assumed zero
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(258) : error 029: invalid expression, assumed zero
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(259) : error 029: invalid expression, assumed zero
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(260) : error 029: invalid expression, assumed zero
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(261) : error 029: invalid expression, assumed zero
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(253) : warning 204: symbol is assigned a value that is never used: "a"
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(252) : warning 204: symbol is assigned a value that is never used: "z"
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(251) : warning 204: symbol is assigned a value that is never used: "y"
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(250) : warning 204: symbol is assigned a value that is never used: "x"
C:\Users\Omar Masri\Desktop\xTorMz Freeroam\gamemodes\xTorMzFreeroam.pwn(2275) : error 021: symbol already defined: "OnPlayerDeath"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
10 Errors.