public robbingcasinovaultcountdown() { for(new i=0; i < MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) { if(robbingcasinovault[i] >= 2) { robbingcasinovault[i] --; new string[256]; new robtimer; robtimer = (robbingcasinovault[i]); format(string, sizeof(string), "~y~OPENING DOOR~n~~b~STAY IN THE CHECKPOINT~n~~w~OPEN IN~r~ %d~w~ SECONDS",robtimer); GameTextForPlayer(i, string, 3000,3); } if(robbingcasinovault[i] == 1) { new string[256]; format(string, sizeof(string), "You Have Managed To Gain Access To The Vault Door"); SendClientMessage(i,COLOR_YELLOW2, string); } } } } |
// With all the other new definitions.
new Robbed[MAX_PLAYERS];
// In OnPlayerConnect.
Robbed[playerid] = 0;
// Replace your old one with this.
public robbingcasinovaultcountdown()
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(robbingcasinovault >= 2)
{
robbingcasinovault --;
new string[256];
new robtimer;
robtimer = (robbingcasinovault);
format(string, sizeof(string), "~y~OPENING DOOR~n~~b~STAY IN THE CHECKPOINT~n~~w~OPEN IN~r~ %d~w~ SECONDS",robtimer);
GameTextForPlayer(i, string, 3000,3);
}
if(robbingcasinovault == 1)
{
if(Robbed[playerid] == 0)
{
new string[256];
format(string, sizeof(string), "You Have Managed To Gain Access To The Vault Door");
SendClientMessage(i,COLOR_YELLOW2, string);
Robbed[i] = 1;
}
}
}
}
}