CountDown for players in range
#1

Hey All,

I created a countdown command (/count) for my server and it works but i wanna make it like that only players that in range (20.0 or so) of the player who did /count see it.. (I'm just using SendClientMessage).

Does someone know this?

Thanks,
[ECR]SancheZ
Reply
#2

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i ++)
{
  if(IsPlayerConnected)
  {
    if(IsPlayerInRangeOfPoint(i, x, y, z)) // you will have to get x y and z by yourself... use GetPlayerPos
    {
       // your code to show the the textdraw, remeber that playerid is now i
    }
  }
}
Reply
#3

Yeah but i dont have a X, Y, Z pos. I need just the position where the player is that did /count.

Sorry i'm not the best scripter around here, maybe need some help.
Reply
#4

Код:
//Top
new Float:Pos[3];
//in command
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);

//in public
for(new i,g=GetMaxPlayers(); i < g; i ++)
{
  if(IsPlayerConnected(i))
  {
    if(IsPlayerInRangeOfPoint(i,/*range*/20.0,Pos[0],Pos[1],Pos[2])) // you will have to get x y and z by yourself... use GetPlayerPos
    {
       // your code to show the the textdraw, remeber that playerid is now i
    }
  }
}
Reply
#5

Quote:
Originally Posted by Jefff
Код:
//Top
new Float:Pos[3];
//in command
GetPlayerPos(playerid,Pos[0],Pos[1],Pos[2]);

//in public
for(new i,g=GetMaxPlayers(); i < g; i ++)
{
  if(IsPlayerConnected(i))
  {
    if(IsPlayerInRangeOfPoint(i,/*range*/20.0,Pos[0],Pos[1],Pos[2])) // you will have to get x y and z by yourself... use GetPlayerPos
    {
      // your code to show the the textdraw, remeber that playerid is now i
    }
  }
}
Thank you

Will try this when im at home.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)