#1

How can i check how close a person is to another. [0.3]

I'm making a cuff command and it's complicated because IsPlayerInRangeOfPlayer was for 0.2
Reply
#2

something like this:

if( (GetDistanceBetweenPlayers(playerid,giveplayerid) <
Reply
#3

Not a function, Don't even have to try that to know
Reply
#4

Anyone?
Reply
#5

https://sampwiki.blast.hk/wiki/Useful_Fu...BetweenPlayers Hope this will help
Reply
#6

How can i use that to see if there 2 meters from each other?
Reply
#7

Quote:
Originally Posted by ScottCFR
How can i use that to see if there 2 meters from each other?
An example :
pawn Код:
if(strcmp(cmd, "/cuff", true) == 0)
  {
  if(GetDistanceBetweenPlayers(playerid,giveplayerid) > 4) //here you can see this > this means if it's more than 4 that you cant cuff him...
  {
  format(string, sizeof(string), "%s(%d) Is not close enough you cannot handcuff that player",pname, giveplayerid);
  SendClientMessage(playerid, COLOR_ERROR, string);
  return 1;
  }
  if(GetPlayerState(giveplayerid) == PLAYER_STATE_ONFOOT) {
  //rest of the code lol
  return 1;
  }
Reply
#8

Thanks man
Reply
#9

Quote:
Originally Posted by ScottCFR
Thanks man
Pritty much what I said.
Reply
#10

If you would have said "Look for an include" or "Here look at the wiki" but still. Thanks to both of you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)