Problem with rob
#1

I have problem when i rob bank cash is going to another player not me who rob

Код:
public RobTime(playerid)
{
        new string[128];
        new cash = random(100000);
        GivePlayerMoney(playerid, cash);
        gPlayerRobbing[playerid] = false;
        KillTimer(general_timer);
        format(string, sizeof(string), "You have successfully robbed $%d from the bank!", cash);
        SendClientMessage(playerid, red, string);
}
Reply
#2

Show the part where you start the timer
Reply
#3

Код:
CMD:rob(playerid, params[])
{
        if(IsPossible == 1) 
        {
                if(IsPlayerInRangeOfPoint(playerid, 3.0, 2309.3491,-14.6412,26.7422))
				{
				}
                else return SendClientMessage(playerid, red, "You must be inside");
                {
                    IsPossible = 0;
                    SetTimer("Waittimer", 300000, false); 
                    general_timer = SetTimer("RobTime", 60000, false);
                    SendClientMessage(playerid, red, "You are robbing the bank!");
                    SendClientMessage(playerid, red, "You gonna stay 19 seconds in the bank in order to rob it!");

                    gPlayerRobbing[playerid] = true;
                 }
        } else {
            SendClientMessage(playerid, red, "You can't rob the bank right now!");
        }
        return 1;
}
Reply
#4

Change your timers to SetTimerEx, and your new general_timer; to new general_timer[MAX_PLAYERS];
PHP код:
SetTimerEx("Waittimer"300000false"i"playerid); 
general_timer[playerid] = SetTimerEx("RobTime"60000false"i"playerid); 
And in public RobTime and everywhere else where you used general_timer, add playerid like
PHP код:
public RobTime(playerid)
//KillTimer(general_timer);
KillTimer(general_timer[playerid]); 
Reply
#5

Try:
PHP код:
general_timer SetTimerEx("RobTime"60000false"i"playerid); 
EDIT: Shinja was faster
Reply
#6

Quote:
Originally Posted by DarkSkull
Посмотреть сообщение
Try:
PHP код:
general_timer SetTimerEx("RobTime"60000false"i"playerid); 
EDIT: Shinja was faster
Yeah and bro you forgot, general_timer[MAX_PLAYERS]
Reply
#7

Quote:
Originally Posted by Shinja
Посмотреть сообщение
Yeah and bro you forgot, general_timer[MAX_PLAYERS]
Oh yeah My bad. Now I'm glad you were faster
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)