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



Announce Cmd. - Davz*|*Criss - 18.03.2011

Hey Scripters.

Can anyone tell me how do i make an Announce command.

Like one /announce and another one /announce2 [Style (0-6)] [Time(Miliseconds)] [Text]

Thanks.


Re: Announce Cmd. - admantis - 18.03.2011

pawn Код:
CMD:announce(playerid, params[])
{
    #define Msg SendClientMessage
    if (!IsPlayerAdmin(playerid)) return
        Msg(playerid, 0xFF0000AA, "Only for admins.");
       
    new text[64], timems, style;
    if (sscanf(params, "iis[64]", style, timems, text)) return
        Msg(playerid, 0xFF0000AA, "Usage: /announce <style[0-6]> <time in ms> <text>");

    if (strlen(text) > 64) return
        Msg(playerid, 0xFF0000AA, "Message is too long (64 characters)");

    if (style < 0 || style > 6) return
        Msg(playerid, 0xFF0000AA, "Invalid style");

    if (time > 20*1000) return
        Msg(playerid, 0xFF0000AA, "No longer than 20 seconds");
       
    GameTextForAll(text, timems, style);
    #undef Msg
    return true;
}



Re: Announce Cmd. - Davz*|*Criss - 18.03.2011

Thanks for the code.


Re: Announce Cmd. - Davz*|*Criss - 18.03.2011

There is one bug when i do /announce 2 1000 hi

The text stay display in my screen and not go? why.

other all are fine.

thnx for that.

please help me in this.


Respuesta: Announce Cmd. - Code8976Man - 18.03.2011

Text 2 doesnt dissapear. Add this:

pawn Код:
if(style == 2) return Msg(playerid, 0xFF0000AA, "You can't choose 2");



Re: Announce Cmd. - admantis - 18.03.2011

Ugh yes, I was about to say that.
Look at the game text styles at wiki to see what effect they may have, sometimes 'time' parameter is not accurate with determinated styles.


Re: Announce Cmd. - Davz*|*Criss - 18.03.2011

thnx you both.