Quantcast
Channel: SA-MP Forums - Filterscripts
Viewing all articles
Browse latest Browse all 595

[FilterScript] First

$
0
0
Textdraw based Random Messages

Features
  • Messages aren't repeated.
  • Selected randomly.
  • Very easy to add new messages.
  • Textdraw based.

PHP Code:

#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;



Viewing all articles
Browse latest Browse all 595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>