SA-MP Forums Archive
Advertisements - 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: Advertisements (/showthread.php?tid=262239)



Advertisements - 0_o - 17.06.2011

i have advertisements in my server, but 2 advertisements show up on 1 time, the timer is 30000


Re: Advertisements - Stigg - 17.06.2011

A snippet of your code might help.


Re: Advertisements - 0_o - 17.06.2011

Quote:
Originally Posted by Stigg
Посмотреть сообщение
A snippet of your code might help.
pawn Код:
adtimer = SetTimer("Advertisements", 300000, 1);



Re: Advertisements - Wesley221 - 17.06.2011

Show the things that are inside the timer, the callback


Re: Advertisements - 0_o - 17.06.2011

Quote:
Originally Posted by Wesley221
Посмотреть сообщение
Show the things that are inside the timer, the callback
pawn Код:
public Advertisements()
{

    new dice = random(8)+1;
    ad = dice;
    Advertisements2();

    return 1;
}

public Advertisements2()
{

    new string[255];
    new ftext[255];
    if(ad == 1) { ftext = "/help."; }
    else if(ad == 2) { ftext = "shop."; }
    else if(ad == 3) { ftext = ":D:D:D"; }
    else if(ad == 4) { ftext = "ohd."; }
    else if(ad == 5) { ftext = "Advert"; }
    else if(ad == 6) { ftext = "wewq"; }
    else if(ad == 7) { ftext = "adad"; }
    else if(ad == 8) { ftext = " faf"; }
    format(string, sizeof(string), "%s", ftext);
    SendClientMessageToAll(COLOR_LIGHTBLUE, string);

    return 1;
}
not sure but i think it happens when there are more than 2 players ingame


Re: Advertisements - Seven_of_Nine - 17.06.2011

Use random() instead.


Re: Advertisements - 0_o - 17.06.2011

Quote:
Originally Posted by Seven_of_Nine
Посмотреть сообщение
Use random() instead.
pawn Код:
L:\San Andreas Gangwars\SAGW\gamemodes\SAGW.pwn(3098) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Warning.



Re: Advertisements - 0_o - 17.06.2011

Please Help. It Shows up 2 At 1 time when there are more than 2 players.


Re: Advertisements - sleepysnowflake - 17.06.2011

When he mean random() You have to put a number in there, in your case 8, because there are 8 things you want to show. Example : random(8)