Timer/Countdown/Million
#1

Hello i have a countdown thing but when its finished i wanted it to say "You Have Managed To Gain Access To The Vault Door''
But it says it but says it LOTS of times and never stops any ideas why? Thanks


Quote:

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);
}

}
}
}

Reply
#2

https://sampwiki.blast.hk/wiki/SetTimer

You could check that out, notice that it has repeat, you put either true or false in it.

I'm suggesting this because I had a similar problem to you, then I changed it to false and it worked

Hope this helps
Reply
#3

pawn Code:
// 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;
        }
     }

   }
  }
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)