SA-MP Forums Archive
Help? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Help? (/showthread.php?tid=135308)



Help? - ScottCFR - 20.03.2010

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


Re: Help? - [LSR]State_Trooper - 20.03.2010

something like this:

if( (GetDistanceBetweenPlayers(playerid,giveplayerid) <


Re: Help? - ScottCFR - 20.03.2010

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


Re: Help? - ScottCFR - 20.03.2010

Anyone?


Re: Help? - MaykoX - 20.03.2010

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


Re: Help? - ScottCFR - 20.03.2010

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


Re: Help? - MaykoX - 20.03.2010

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;
  }



Re: Help? - ScottCFR - 20.03.2010

Thanks man


Re: Help? - [LSR]State_Trooper - 20.03.2010

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


Re: Help? - ScottCFR - 20.03.2010

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