21.01.2017, 14:56
6 Errors on compiling, gj mate, gj
Fixed Version (still not worth releasing):
Also give your topic a proper name ^^
Fixed Version (still not worth releasing):
PHP код:
#define MAX_MESSAGE_SIZE 150
new Text:RandomMsgTD, RandomMsgID;
new RandomMsgs[][MAX_MESSAGE_SIZE] =
{
"Message number 1",
"Message number 2",
"Message number 3"
};
public OnFilterScriptInit()
{
RandomMsgTD = TextDrawCreate(8.000000, 431.000000, "~p~~h~News ~w~_.");
TextDrawBackgroundColor(RandomMsgTD, 255);
TextDrawFont(RandomMsgTD, 2);
TextDrawLetterSize(RandomMsgTD, 0.200000, 1.200000);
TextDrawColor(RandomMsgTD, -1);
TextDrawSetOutline(RandomMsgTD, 1);
TextDrawSetProportional(RandomMsgTD, 1);
TextDrawSetSelectable(RandomMsgTD, 0);
RandomMessage();
SetTimer("RandomMessage", 45000, true);
return 1;
}
public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, RandomMsgTD);
}
public OnPlayerDisconnect(playerid, reason){
{
TextDrawHideForPlayer(playerid, RandomMsgTD);
}
forward RandomMessage();
public RandomMessage()
{
new rID = getNewRandomMessageID();
new string[MAX_MESSAGE_SIZE + 15 /*because of the stuff infront of the actual message*/];
format(string, sizeof(string), "~r~News ~w~%s", RandomMsgs[rID]);
TextDrawSetString(RandomMsgTD, string);
return 1;
}
getNewRandomMessageID()
{
new newRandomID = random(sizeof(RandomMsgs));
return newRandomID == RandomMsgID ? getNewRandomMessageID() : newRandomID;
}