Set a timer for robbery anims.
#1

Hi, I'm using this anims for robbery but i want to set a timer like for 30 seconds. After 30 seconds player should be out of animation.

PHP код:
ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob"1100001); 
how to set a timer for it

PHP код:
if(ROBBING_PIZZA1[i] > 1// Checking if robbery time is above 1
                
{
                    
ROBBING_PIZZA1[i] --; // Decreasing time
                    
new time[256]; //adding time variable
                    
format(time,sizeof(time),"~y~Robbery Time: %d~n~~r~DO NOT MOVE UNTIL THE~n~ROBBERY IS COMPLETED",ROBBING_PIZZA1[i]);
                    
GameTextForPlayer(i,time,3000,3); //shows gametext showing the time remaining for the robbery
                    
ApplyAnimation(i,"ROB_BANK","CAT_Safe_Rob"11000103);
                }
                if(
ROBBING_PIZZA1[i] == 1// IF the timer reached 1
                
{
                    new 
string[256], pName[MAX_PLAYER_NAME];// getting player name
                    
GetPlayerName(i,pName,MAX_PLAYER_NAME);
                    
ROBBING_PIZZA1[i] =0// RESET timer
                    
new earning =random(35000);
                    
format(string,sizeof(string),"%s (%d) has stolen $%d from Well Stacked Pizza",pName,i,earning);
                    
SendClientMessageToAll(COLOR_CYAN,string);
                    
format(string,sizeof(string),"ROBBERY COMPLETED");
                    
GameTextForPlayer(i,string10003);
                    
GivePlayerCashEx(iearning);
                    
SetPlayerWantedLevelEx(iGetPlayerWantedLevel(i) + 1); //giving player 1 wanted level
                    
GivePlayerScore(i,1);
                    
pInfo[i][pStoreRobbed] ++;
                    
pInfo[i][pStoreRobbedMoney] = pInfo[i][pStoreRobbedMoney] +earning;
                } 
Reply


Messages In This Thread
Set a timer for robbery anims. - by STONEGOLD - 18.06.2015, 04:38
Re: Set a timer for robbery anims. - by STONEGOLD - 18.06.2015, 04:49
Re: Set a timer for robbery anims. - by STONEGOLD - 18.06.2015, 05:34
Re: Set a timer for robbery anims. - by Gammix - 18.06.2015, 05:47
Re: Set a timer for robbery anims. - by STONEGOLD - 18.06.2015, 06:07
Re: Set a timer for robbery anims. - by J0sh... - 18.06.2015, 06:12
Re: Set a timer for robbery anims. - by STONEGOLD - 18.06.2015, 06:29

Forum Jump:


Users browsing this thread: 3 Guest(s)