Playertopoint help
#1

I have this in my script

Code:
forward PlayerToPoint (Float:radi, playerid, Float:x, Float:y, Float:z);
and this code
Code:
if (strcmp("/claim", cmdtext, true, 10) == 0)
	{
    if(PlayerToPoint(15.0, playerid, 2516.3457,-1675.3977,13.9453))

	  
 	  SendClientMessageToAll(COLOR_GREEN, "%s has claimed Grove Street Families turf !");
	  return 1;
	}
I dont know why it's giving me errors
Reply
#2

Yoou don't have PlayerToPoint function.
Add this at end of your script
pawn Code:
PlayerToPoint(Float:radius, playerid, Float:X, Float:Y, Float:Z)
{
  new Float:oldpos[3], Float:temppos[3];
  GetPlayerPos(playerid, oldpos[0], oldpos[1], oldpos[2]);
  temppos[0] = (oldpos[0] -X);
  temppos[1] = (oldpos[1] -Y);
  temppos[2] = (oldpos[2] -Z);
  if(((temppos[0] < radius) && (temppos[0] > -radius)) && ((temppos[1] < radius) && (temppos[1] > -radius)) && ((temppos[2] < radius) && (temppos[2] > -radius)))
  {
    return true;
  }
  return false;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)