[Tutorial] How to make random messages using textdraws
#6

pawn Код:
// This is a comment
// uncomment the line below if you want to write a filterscript
#define FILTERSCRIPT

#include <a_samp>

#if defined FILTERSCRIPT

new Text:randommsg;

new RandomMessages[][] =
{
    "~y~Community Name: ~w~Your Text ~g~here.",
    "~y~Community Name: ~w~Your Text ~r~here.",
    "~y~Community Name: ~w~Your Text ~y~here.",
    "~y~Community Name: ~w~Your Text ~b~here."
};

public OnFilterScriptInit()
{
    SetTimer("RandomMessage",8000,1);
    randommsg = TextDrawCreate(7.000000, 427.000000, "You don't need to add any text here");
    TextDrawBackgroundColor(randommsg, 255);
    TextDrawFont(randommsg, 1);
    TextDrawLetterSize(randommsg, 0.379999, 1.499999);
    TextDrawColor(randommsg, -1);
    TextDrawSetOutline(randommsg, 1);
    TextDrawSetProportional(randommsg, 1);
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

forward RandomMessage();
public RandomMessage()
{
    TextDrawSetString(randommsg, RandomMessages[random(sizeof(RandomMessages))]);
    return 1;
}

public OnPlayerConnect(playerid)
{
    TextDrawShowForPlayer(playerid, randommsg);
    return 1;
}

#else

main()
{
    print("\n----------------------------------");
    print(" Blank Gamemode by your name here");
    print("----------------------------------\n");
}

#endif
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)