#define CONNECT_MESSAGES (5)
new Text:ConnectTextdraw[CONNECT_MESSAGES];
new CurrentIndex;
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], string[64];
GetPlayerName(playerid, playerName, sizeof(playerName));
format(string, sizeof(string), "~g~join:~w~%s(%i)", playerName, playerid);
TextDrawHideForAll(ConnectTextdraw[CurrentIndex]);
TextDrawSetString(ConnectTextdraw[CurrentIndex], string);
TextDrawShowForAll(ConnectTextdraw[CurrentIndex]);
for(new i=0; i < CONNECT_MESSAGES; i++)
{
TextDrawShowForPlayer(playerid, ConnectTextdraw[i]);
}
return (CurrentIndex + 1 != CONNECT_MESSAGES) ? (CurrentIndex ++) : (CurrentIndex = 0);
}
public OnPlayerDisconnect(playerid, reason)
{
new playerName[MAX_PLAYER_NAME], string[64];
GetPlayerName(playerid, playerName, sizeof(playerName));
format(string, sizeof(string), "~r~%s: ~w~%s(%i)", (reason == 0) ? ("TIME") : ((reason == 1) ? ("QUIT") : ("KICK")),playerName, playerid);
TextDrawHideForAll(ConnectTextdraw[CurrentIndex]);
TextDrawSetString(ConnectTextdraw[CurrentIndex], string);
TextDrawShowForAll(ConnectTextdraw[CurrentIndex]);
return (CurrentIndex + 1 != CONNECT_MESSAGES) ? (CurrentIndex ++) : (CurrentIndex = 0);
}
public OnGameModeExit()
{
for(new i=0; i < CONNECT_MESSAGES; i++)
{
TextDrawDestroy(ConnectTextdraw[i]);
}
return 1;
}
#include <a_samp>
#define CONNECT_MESSAGES (5)
new Text:ConnectTextdraw[CONNECT_MESSAGES];
new CurrentStr[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;
}
#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;
}
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
switch(reason)
{
case 0: format(string, sizeof(string), "%s left the server [crash].", pname);
case 1: format(string, sizeof(string), "%s left the server [/q].", pname);
case 2: format(string, sizeof(string), "%s left the server [kick/ban]", pname);
}
SendClientMessageToAll(0xFFFFFFAA, string);
return 1;
}
PHP код:
|
I have loaded this as an FS and it works fine for me: (Latest is at bottom, oldest at top).
pawn Код:
|