Displaying More Ad's - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Displaying More Ad's (
/showthread.php?tid=133724)
Displaying More Ad's -
master000 - 13.03.2010
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?
Re: Displaying More Ad's -
Chriham3 - 13.03.2010
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.
Re: Displaying More Ad's -
master000 - 13.03.2010
Thanks!
Worked Great!