SA-MP Forums Archive
Player Position is not working for me? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Player Position is not working for me? (/showthread.php?tid=450439)



Player Position is not working for me? - arjanforgames - 13.07.2013

I have
pawn Код:
CMD:agate(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 1953.0791,-2433.4441,13.5469, 2.5))
    {
        if(PlayerInfo[playerid][pTeam] == 1)
        {
            SendClientMessage(playerid, -1, "Test");
        }
        else
        {
            SendClientMessage(playerid, COLOR_ORANGE, "* You are not in: Team America!");
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_ORANGE, "* You are not in range of your garage!");
    }
    return 1;
}
If I do /agate somewhere random I get: "You are not in range of your garage". So working
If I do /agate at the coords when im in the team I get: "You are not in range of your garage", While I am.
If I do /agate while in the team I get: "You are not in range of your garage".

Help!


Re: Player Position is not working for me? - ToiletDuck - 13.07.2013

make the radius to 5 instead of 2.5
if still doesn't work
pawn Код:
if(!IsPlayerInRangeOfPoint(playerid,  5.0, 1953.0791,-2433.4441,13.5469))



Re: Player Position is not working for me? - JimmyCh - 13.07.2013

Yo, use this code:

pawn Код:
CMD:agate(playerid, params[])
{
  if(IsPlayerInRangeOfPoint(playerid, 2.5, 1953.0791,-2433.4441,13.5469))
  {
            if(PlayerInfo[playerid][pTeam] == 1)
            {
            SendClientMessage(playerid, -1, "Test");
             }
            else
            {
            SendClientMessage(playerid, COLOR_ORANGE, "* You are not in: Team America!");
            return 1;
            }
   }
  else
  {
  SendClientMessage(playerid, COLOR_ORANGE, "* You are not in range of your garage!");
  return 1;
  }
return 1;
}

Hope I helped!


Re: Player Position is not working for me? - EV007 - 13.07.2013

You had the radius in the wrong place, Jimmy's code should do the trick


Re: Player Position is not working for me? - arjanforgames - 13.07.2013

Thanks alot.