24.12.2011, 09:37
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;
}