24.03.2010, 10:16
Here's a IsPlayerInAmmunation function.
Example code:
pawn Код:
new Float: Ammunation_Coordinates[][3] = {
{ 286.148986,-40.644397,1001.515625 },
{ 286.800994,-82.547599,1001.515625 },
{ 296.919982,-108.071998,1001.515625 },
{ 314.820983,-141.431991,999.601562 },
{ 316.524993,-167.706985,999.593750 }
};
pawn Код:
stock IsPlayerInAmmunation(playerid) {
for(new i = 0; i < sizeof(Ammunation_Coordinates); i++) {
if(IsPlayerInRangeOfPoint(playerid, 70.0, Ammunation_Coordinates[i][0], Ammunation_Coordinates[i][1], Ammunation_Coordinates[i][2])) return 1;
}
return 0;
}
pawn Код:
if(IsPlayerInAmmunation(playerid)) {
printf("Id %d is in a Ammunation", playerid);
}