01.12.2010, 17:17
Hey,
I have this little snippet from my code, I know it's badly indented, I quickly wrote it.
But I can't figure out the correct way of getting the closest players (except playerid (yourself)) in a certain position, (in this case, a vehicle.) Should I make new variables or smth?
pawn Код:
new Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
for(new i = 0; i < MAX_PLAYERS; ++i)
if(IsPlayerConnected(i))
if( i != playerid)
{
if(IsPlayerInRangeOfPoint(i,7,x,y,z))
{
CreateExplosion(x,y,z,7,10.0);
CreateExplosion(x,y+2,z,7,10.0);
CreateExplosion(x,y-2,z,7,10.0);
But I can't figure out the correct way of getting the closest players (except playerid (yourself)) in a certain position, (in this case, a vehicle.) Should I make new variables or smth?