18.06.2015, 04:38
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.
how to set a timer for it
PHP код:
ApplyAnimation(playerid,"ROB_BANK","CAT_Safe_Rob", 1, 1, 0, 0, 0, 0, 1);
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", 1, 1, 0, 0, 0, 10, 3);
}
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,string, 1000, 3);
GivePlayerCashEx(i, earning);
SetPlayerWantedLevelEx(i, GetPlayerWantedLevel(i) + 1); //giving player 1 wanted level
GivePlayerScore(i,1);
pInfo[i][pStoreRobbed] ++;
pInfo[i][pStoreRobbedMoney] = pInfo[i][pStoreRobbedMoney] +earning;
}