[FilterScript] First
#1

Textdraw based Random Messages

Features
  • Messages aren't repeated.
  • Selected randomly.
  • Very easy to add new messages.
  • Textdraw based.
PHP код:
#include a_samp
new
    
Text RandomMsgTD,
    
RandomMsgID = -1,
    
RandomMsgs[][] =
{
    
"Message number 1"
    
"Message number 2"
    
"Message number 3"
};
public 
OnFilterScriptInit()
{
    
RandomMsgTD TextDrawCreate(8.000000431.000000, ~p~~h~News ~w~_.);
    
TextDrawBackgroundColor(RandomMsgTD255);
    
TextDrawFont(RandomMsgTD2);
    
TextDrawLetterSize(RandomMsgTD0.2000001.200000);
    
TextDrawColor(RandomMsgTD, -1);
    
TextDrawSetOutline(RandomMsgTD1);
    
TextDrawSetProportional(RandomMsgTD1);
    
TextDrawSetSelectable(RandomMsgTD0);
    
    
RandomMessage();
    
SetTimer(RandomMessage45000true);
    return 
1;
}
public 
OnPlayerConnect(playeridTextDrawShowForPlayer(playeridRandomMsgTD);
public 
OnPlayerDisconnect(playeridreasonTextDrawHideForPlayer(playeridRandomMsgTD);
forward RandomMessage();
public  
RandomMessage()
{
    
reselect_msg
    
new string[150], rID random(sizeof RandomMsgs);
    if(
RandomMsgID == rID) goto reselect_msg;
    
format(stringsizeof string, ~r~News ~w~%sRandomMsgs[rID]);
    
TextDrawSetString(RandomMsgTDstring);
    return 
1;

Reply


Messages In This Thread
First - by Rassh - 21.01.2017, 14:29
Re: First - by Logic_ - 21.01.2017, 14:39
Re: First - by CaRaM3LL - 21.01.2017, 14:50
Re: First - by Codeah - 21.01.2017, 14:53
Re: First - by BiosMarcel - 21.01.2017, 14:56
Re: First - by Logic_ - 21.01.2017, 15:25
Re: First - by Quinncell - 21.01.2017, 16:12
Re: First - by RyderX - 21.01.2017, 16:56
Re: First - by RyderX - 21.01.2017, 17:04
Re: First - by BiosMarcel - 21.01.2017, 17:19

Forum Jump:


Users browsing this thread: 2 Guest(s)