First:
Among with all other forwards, add
pawn Код:
forward Advertisements();
forward Advertisements2();
In ongamemodeinit add:
pawn Код:
adtimer = SetTimer("Advertisements", 300000, 1);
declare:
in the gamemodeexit add:
declare:
Add these functions:
pawn Код:
public Advertisements()
{
new dice = random(7)+1;
ad = dice;
Advertisements2();
return 1;
}
public Advertisements2()
{
new string[255];
new ftext[255];
if(ad == 1) { ftext = "~ ADVERT HERE ~"; }
else if(ad == 2) { ftext = "~ ADVERT HERE ~"; }
else if(ad == 3) { ftext = "~ ADVERT HERE ~"; }
else if(ad == 4) { ftext = "~ ADVERT HERE ~"; }
else if(ad == 5) { ftext = "~ ADVERT HERE ~"; }
else if(ad == 6) { ftext = "~ ADVERT HERE ~"; }
else if(ad == 7) { ftext = "~ ADVERT HERE ~"; }
format(string, sizeof(string), "%s", ftext);
SendClientMessageToAll(0xFF800096, string);
return 1;
}
Hope that works for you.