OnPlayerUpdate SendClientMessage GameTextForPlayer
#1

Hi, i have this script:

public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 10, -2464.9296875,1522.9167480469,27.570457458496))
{
SendClientMessage(playerid, 0x99FF66AA, "Use /lift to bring the lift up and /lift to take it back down");
GameTextForPlayer(playerid, "/lift to bring the lift up and /lift to take it back down", 5000, 5);
}
return 1;
}

But how do i make it so that it only sends it once, not spamming me?
Reply
#2

Sorry for hypocritical bump but this is needed desperately!
Reply
#3

It's better if you search for a script which has functions like OnPlayerEnterArea / OnPlayerExitArea. That would be more useful in this case.
Reply
#4

You used OnPlayerUpdate, thats a callback thats runned a hell many times in a second.
Use a timer insted that doesnt repeat itself, unless the line SetTimer(Ex) is runned again
Reply
#5

i used seifs thing but i cant make it work:

Код:
  AREA_lift=AddAreaCheck(-2455.066894, -2475.107421, 1530.183959, 1518.064697);
Код:
OnPlayerEnterArea(playerid,areaid) {
  if (areaid==AREA_lift)
  {
  SendClientMessage(playerid, 0x99FF66AA, "Use /lift to bring the lift up and /lift to take it back down");
  GameTextForPlayer(playerid, "/lift to bring the lift up and /lift to take it back down", 5000, 5);
  }
  return 1;
}

OnPlayerLeaveArea(playerid,areaid) {
  if (areaid==AREA_lift)
  {
  SendClientMessage(playerid, 0x99FF66AA, "Thanks for using the lift!");
  GameTextForPlayer(playerid, "Thanks for using the lift!", 5000, 5);
  }
  return 1;
}
Reply
#6

BUMP!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)