IsPlayerInArea help please!
#1

remove
Reply
#2

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;
  }
Reply
#3

Not good
Reply
#4

Код:
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;
  }
Reply
#5

No.. it is not work :S
Reply
#6

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

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

Код:
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;
  }
Reply
#9

Umm it works, thanks!!
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)