Command Robbank need some help (+rep)
#1

Hello I try to make Bank Robbery System but without enough information about Timers and same
I want to make when you die or get out from the bank to not give money to robber if you know how please help me.

This is my CMD:robbank

pawn Код:
CMD:robbank(playerid, params[])
{
    new string[128];
    new money = random(10000)+10000;
   
    if(PlayerInfo[playerid][pLevel] >= 5) return SendClientMessage(playerid, COLOR_YELLOW, "You must be over level 5 to rob the bank.");
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438))
        {
            format(string, sizeof(string), "You have started to setting up robbery you must wait 5 min.");
            SetTimer("robbank", 500000, false);
            GivePlayerMoney(playerid, money);
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
    }
    return 1;
}
Reply
#2

Try this.

pawn Код:
new money = random (10000)+10000;

forward TimerRob(playerid);

public TimerRob(playerid)
{
     TogglePlayerControllable(playerid, 0); //Freeze The Player.
     SendClientMessage(playerid, -1, "[INFO]: Rob the Bank... Please Wait");
     return 1;
}

CMD:robbank(playerid, params[])
{
    new string[128];
   
    if(PlayerInfo[playerid][pLevel] >= 5) return SendClientMessage(playerid, COLOR_YELLOW, "You must be over level 5 to rob the bank.");
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, 2695.6880, -1704.6300, 11.8438))
        {
            format(string, sizeof(string), "You have started to setting up robbery you must wait 5 min.");
            SetTimerEx("TimerRob", 500000, false, "i", playerid);
            GivePlayerMoney(playerid, money);
            SendClientMessage(playerid, COLOR_YELLOW, string);
        }
    }
    return 1;
}
Reply
#3

Yea It's very good but it freeze player for 5 minutes and when you die or get out when 5 minutes end you take money
Reply
#4

Quote:
Originally Posted by RenSoprano
Посмотреть сообщение
Yea It's very good but it freeze player for 5 minutes and when you die or get out when 5 minutes end you take money
Yes... change the TogglePlayerControllable to 1 and test the SetTimerEx ^^
Reply
#5

I do it already but I want when you get out from bank or die to not give me money and timer doesn't stuck with GivePlayerMoney its give it to me directly without waiting
Reply
#6

work with a bool

pawn Код:
new bool:rob;

//when stealing
rob = true;

//when you die or exit bank
rob = false;

//in the timer
forward robbank();
public robbank() {
    if(rob == true) {
        //functions
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)