join/kick/leave messages not in order
#4

I have loaded this as an FS and it works fine for me: (Latest is at bottom, oldest at top).

pawn Код:
#include <a_samp>
#define CONNECT_MESSAGES (5)

new Text:ConnectTextdraw[CONNECT_MESSAGES];
new CurrentStr[5][64];

public OnFilterScriptInit()
{
    for(new i=0; i < CONNECT_MESSAGES; i++)
    {
        ConnectTextdraw[i] = TextDrawCreate(496.000000, 253.000000 + (i * 10), "_");

        TextDrawBackgroundColor(ConnectTextdraw[i], 255);
        TextDrawFont(ConnectTextdraw[i], 1);
        TextDrawLetterSize(ConnectTextdraw[i], 0.2, 1.2);
        TextDrawColor(ConnectTextdraw[i], -1);
        TextDrawSetOutline(ConnectTextdraw[i], 1);
        TextDrawSetProportional(ConnectTextdraw[i], 1);
    }
    return 1;
}

public OnPlayerConnect(playerid)
{
    new playerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playerName, sizeof(playerName));

    CurrentStr[0] = CurrentStr[1];
    CurrentStr[1] = CurrentStr[2];
    CurrentStr[2] = CurrentStr[3];
    CurrentStr[3] = CurrentStr[4];

    format(CurrentStr[4], sizeof(CurrentStr[]), "~g~join:~w~%s(%i)", playerName, playerid);
    for(new i=0; i < CONNECT_MESSAGES; i++)
    {
        TextDrawSetString(ConnectTextdraw[i], CurrentStr[i]);
        TextDrawShowForPlayer(playerid, ConnectTextdraw[i]);
    }
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    new playerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playerName, sizeof(playerName));

    CurrentStr[0] = CurrentStr[1];
    CurrentStr[1] = CurrentStr[2];
    CurrentStr[2] = CurrentStr[3];
    CurrentStr[3] = CurrentStr[4];

    format(CurrentStr[4], sizeof(CurrentStr[]), "~r~%s: ~w~%s(%i)", (reason == 0) ? ("TIME") : ((reason == 1) ? ("QUIT") : ("KICK")),playerName, playerid);
    for(new i=0; i < CONNECT_MESSAGES; i++) TextDrawSetString(ConnectTextdraw[i], CurrentStr[i]);
    return 1;
}

public OnGameModeExit()
{
    for(new i=0; i < CONNECT_MESSAGES; i++)
    {
        TextDrawDestroy(ConnectTextdraw[i]);
    }
    return 1;
}
Reply


Messages In This Thread
join/kick/leave messages not in order - by SnG.Scot_MisCuDI - 22.12.2011, 04:00
Re: join/kick/leave messages not in order - by Jeffry - 22.12.2011, 09:53
Re: join/kick/leave messages not in order - by SnG.Scot_MisCuDI - 22.12.2011, 19:02
Re: join/kick/leave messages not in order - by Jeffry - 24.12.2011, 09:37
Re: join/kick/leave messages not in order - by ProdrifterX - 24.12.2011, 11:53
Re: join/kick/leave messages not in order - by SnG.Scot_MisCuDI - 24.12.2011, 19:03
Re: join/kick/leave messages not in order - by SnG.Scot_MisCuDI - 24.12.2011, 19:09
Re: join/kick/leave messages not in order - by Jeffry - 25.12.2011, 11:18

Forum Jump:


Users browsing this thread: 1 Guest(s)