Displaying More Ad's
#1

How do I make it so In-Game more than 1 ad is displayed at 1 time.
I want it to be like this in-game:
Quote:

[AD:] whatever
[AD:] WHATEVER
[NOTE:] DFSDF
[AD:] WHATEVER

And how do I add a timer, so the ad displays after 10 minutes?
Reply
#2

First:

Among with all other forwards, add
pawn Код:
forward Advertisements();
forward Advertisements2();
In ongamemodeinit add:
pawn Код:
adtimer = SetTimer("Advertisements", 300000, 1);
declare:
pawn Код:
new adtimer;
in the gamemodeexit add:
pawn Код:
KillTimer(adtimer);
declare:
pawn Код:
new ad = 0;
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.
Reply
#3

Thanks!
Worked Great!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)