SA-MP Forums Archive
IsPlayerInArea help please! - 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: IsPlayerInArea help please! (/showthread.php?tid=121629)



IsPlayerInArea help please! - PRANK - 17.01.2010

remove


Re: IsPlayerInArea help please! - Cry_Wolf - 17.01.2010

pawn Код:
if(strcmp(cmdtext, "/hp", true) == 0)
  {
   if(IsPlayerInArea(playerid, 70.06725, 1296.244, 81.74512, 1436.379)) return SendClientMessage(playerid, red, "You are in DM zone, you can't use this command.");
      SetPlayerHealth(playerid, 100);
    return 1;
  }



Re: IsPlayerInArea help please! - PRANK - 17.01.2010

Not good


Re: IsPlayerInArea help please! - [DM]Kane - 17.01.2010

Код:
if(strcmp(cmdtext, "/hp", true) == 0)
  {
   if(IsPlayerInArea(playerid, 70.06725, 1296.244, 81.74512, 1436.379)) return SendClientMessage(playerid, red, "You are in DM zone, you can't use this command.");
   else {
    SetPlayerHealth(playerid, 100);
    return 1;
  }



Re: IsPlayerInArea help please! - PRANK - 17.01.2010

No.. it is not work :S


Re: IsPlayerInArea help please! - VonLeeuwen - 17.01.2010

pawn Код:
if(strcmp(cmdtext, "/hp", true) == 0)
  {
   if(IsPlayerInArea(playerid, 70.06725, 1296.244, 81.74512, 1436.379)) return SendClientMessage(playerid, red, "You are in DM zone, you can't use this command.");
else
{
SetPlayerHealth(playerid, 100);
}
    return 1;
  }



Re: IsPlayerInArea help please! - Dark_Kostas - 17.01.2010

Are you sure IsPlayerInArea and the co-ords are correct?


Re: IsPlayerInArea help please! - Nakash - 17.01.2010

Код:
if(strcmp(cmdtext, "/hp", true) == 0)
  {
   if(IsPlayerInArea(playerid, 70.06725, 1296.244, 81.74512, 1436.379)) return SendClientMessage(playerid, red, "You are in DM zone, you can't use this command.");
else 
{
SetPlayerHealth(playerid, 100);
}
    return 1;
  }
You didn't add a '!' (If the player is NOT at the area it will return blablabla).
That should work:

Код:
if(strcmp(cmdtext, "/hp", true) == 0)
  {
   if(!IsPlayerInArea(playerid, 70.06725, 1296.244, 81.74512, 1436.379)) return SendClientMessage(playerid, red, "You are in DM zone, you can't use this command.");
else 
{
SetPlayerHealth(playerid, 100);
}
    return 1;
  }



Re: IsPlayerInArea help please! - PRANK - 17.01.2010

Umm it works, thanks!!


Re: IsPlayerInArea help please! - Nakash - 17.01.2010

Quote:
Originally Posted by PRANK
Yes, I tried to change it, but not work.
Okay,then you can use another command instead.
pawn Код:
if(!PlayerToPoint(20.0,playerid,70.06725, 1296.244, 81.74512, 1436.379){ return SendClientMessage(playerid, red, "You are in DM zone, you can't use this command."); }
else { SetPlayerHealth(playerid, 100); return 1; }
EDIT:
I am glad it works.