Getting the closest player - 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: Getting the closest player (
/showthread.php?tid=129998)
Getting the closest player -
jamie009 - 24.02.2010
Ok so I want the command to pick up on a player next to you.. This is what I've got right now
Код:
new policecheck;
policecheck = GetPlayerTeam(playerid);
if(!strcmp(cmd, "/tazer", true))
{
if(policecheck = TEAM_Police)
{
new criminal = ReturnUser(tmp);
GetPlayerName(criminal, criminaltazed, sizeof(criminaltazed));
new playersdistance;
playerdistance = GetDistanceBetweenPlayers(playerid,criminal);
if(playerdistance >4)
{
TogglePlayerControllable(criminal, 0);
}
return 1;
}
Can some one help me out? I was also thinking of using: