/robbank
#6

Quote:
Originally Posted by Nin9r
Посмотреть сообщение
You can use a timer which is verifying if that player is in a range of a point.

Then, you are using the rob variable.

For example:
Код HTML:
new RobCheck[MAX_PLAYERS];
use
Код HTML:
RobCheck[playerid] = SetTimerEx("RobCheck[playerid]", 3000, 1, "d", playerid);
to start the timer.
Код HTML:
forward RobCheck(forward);
public RobCheck(playerid)
{
  if(PlayerVariable[playerid][pRob] == 1)
  {
     if(IsPlayerInRangeOfPoint(playerid, 30.0, x,y,z))
	{
               SendClientMessage(playerid, COLOR_WHITE,"Rob Accepted.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_WHITE, " You are far away from the rob point. Rob Failed.");
            PlayerVariable[playerid][pRob] = 0;
            KillTimer(RobCheck[playerid]);
        }
  }
  return 1;
}
Don't forget to use
Код HTML:
 KillTimer(RobCheck[playerid]);
after rob.
This is a good way but as you need to know if the player is still in the bank

Код HTML:
forward RobCheck(forward);
public RobCheck(playerid)
{
  if(PlayerVariable[playerid][pRob] == 1)
  {
     if(!IsPlayerInRangeOfPoint(playerid, r, x,y,z))
	{
            SendClientMessage(playerid, COLOR_RED, "You exited the bank! Rob failed!");
            PlayerVariable[playerid][pRob] = 0;
            KillTimer(RobCheck[playerid]);
        }
  }
  return 1;
}
Remember to send the Range based on the bank size.
Reply


Messages In This Thread
/robbank - by Micko123 - 16.06.2016, 05:12
Re: /robbank - by xTURBOx - 16.06.2016, 06:11
Re: /robbank - by Micko123 - 16.06.2016, 06:13
Re: /robbank - by Nin9r - 16.06.2016, 08:09
Re: /robbank - by Sime30 - 16.06.2016, 10:00
Re: /robbank - by AaronJ - 16.06.2016, 11:55
Re: /robbank - by Nin9r - 17.06.2016, 11:52

Forum Jump:


Users browsing this thread: 1 Guest(s)