Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Credits for this go to RealCop228
- // You are free to use this any way you want.
- // You must keep these credits here.
- // You may not claim this as your own.
- // You may modify the hell out of this code.
- // You may not re-release this code w/o my permission.
- #include <a_samp>
- new
- Text:TD_line[5],
- szString_0[90],
- szString_1[90],
- szString_2[90],
- szString_3[90],
- szString_4[90];
- public OnFilterScriptInit()
- {
- TD_line[4] = TextDrawCreate(511.000000, 170.000000, ""); // format: ~b~(ID) ~y~USERNAME ~*~TYPE_of_CONNECTION
- TextDrawBackgroundColor(TD_line[4], 255);
- TextDrawFont(TD_line[4], 2);
- TextDrawLetterSize(TD_line[4], 0.209999, 1.100000);
- TextDrawColor(TD_line[4], -1);
- TextDrawSetOutline(TD_line[4], 0);
- TextDrawSetProportional(TD_line[4], 1);
- TextDrawSetShadow(TD_line[4], 1);
- TD_line[3] = TextDrawCreate(511.000000, 182.000000, ""); // format: ~b~(ID) ~y~USERNAME ~*~TYPE_of_CONNECTION
- TextDrawBackgroundColor(TD_line[3], 255);
- TextDrawFont(TD_line[3], 2);
- TextDrawLetterSize(TD_line[3], 0.209999, 1.100000);
- TextDrawColor(TD_line[3], -1);
- TextDrawSetOutline(TD_line[3], 0);
- TextDrawSetProportional(TD_line[3], 1);
- TextDrawSetShadow(TD_line[3], 1);
- TD_line[2] = TextDrawCreate(510.000000, 194.000000, ""); // format: ~b~(ID) ~y~USERNAME ~*~TYPE_of_CONNECTION
- TextDrawBackgroundColor(TD_line[2], 255);
- TextDrawFont(TD_line[2], 2);
- TextDrawLetterSize(TD_line[2], 0.209999, 1.100000);
- TextDrawColor(TD_line[2], -1);
- TextDrawSetOutline(TD_line[2], 0);
- TextDrawSetProportional(TD_line[2], 1);
- TextDrawSetShadow(TD_line[2], 1);
- TD_line[1] = TextDrawCreate(511.000000, 206.000000, ""); // format: ~b~(ID) ~y~USERNAME ~*~TYPE_of_CONNECTION
- TextDrawBackgroundColor(TD_line[1], 255);
- TextDrawFont(TD_line[1], 2);
- TextDrawLetterSize(TD_line[1], 0.209999, 1.100000);
- TextDrawColor(TD_line[1], -1);
- TextDrawSetOutline(TD_line[1], 0);
- TextDrawSetProportional(TD_line[1], 1);
- TextDrawSetShadow(TD_line[1], 1);
- TD_line[0] = TextDrawCreate(511.000000, 218.000000, ""); // format: ~b~(ID) ~y~USERNAME ~*~TYPE_of_CONNECTION
- TextDrawBackgroundColor(TD_line[0], 255);
- TextDrawFont(TD_line[0], 2);
- TextDrawLetterSize(TD_line[0], 0.209999, 1.100000);
- TextDrawColor(TD_line[0], -1);
- TextDrawSetOutline(TD_line[0], 0);
- TextDrawSetProportional(TD_line[0], 1);
- TextDrawSetShadow(TD_line[0], 1);
- for(new i; i < MAX_PLAYERS; i ++)
- {
- if(IsPlayerConnected(i))
- {
- TextDrawShowForPlayer(i, TD_line[0]);
- TextDrawShowForPlayer(i, TD_line[1]);
- TextDrawShowForPlayer(i, TD_line[2]);
- TextDrawShowForPlayer(i, TD_line[3]);
- TextDrawShowForPlayer(i, TD_line[4]);
- }
- }
- return 1;
- }
- public OnFilterScriptExit()
- {
- TextDrawHideForAll(TD_line[0]);
- TextDrawDestroy(TD_line[0]);
- TextDrawHideForAll(TD_line[1]);
- TextDrawDestroy(TD_line[1]);
- TextDrawHideForAll(TD_line[2]);
- TextDrawDestroy(TD_line[2]);
- TextDrawHideForAll(TD_line[3]);
- TextDrawDestroy(TD_line[3]);
- TextDrawHideForAll(TD_line[4]);
- TextDrawDestroy(TD_line[4]);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- szString_4 = szString_3;
- szString_3 = szString_2;
- szString_2 = szString_1;
- szString_1 = szString_0;
- format(szString_0, sizeof(szString_0), "~b~(%d) ~y~%s ~g~JOIN", playerid, getPlayerName(playerid));
- TextDrawSetString(TD_line[0], szString_0);
- TextDrawSetString(TD_line[1], szString_1);
- TextDrawSetString(TD_line[2], szString_2);
- TextDrawSetString(TD_line[3], szString_3);
- TextDrawSetString(TD_line[4], szString_4);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- szString_4 = szString_3;
- szString_3 = szString_2;
- szString_2 = szString_1;
- szString_1 = szString_0;
- switch(reason)
- {
- case 0: format(szString_0, sizeof(szString_0), "~b~(%d) ~y~%s ~r~TIME", playerid, getPlayerName(playerid));
- case 1: format(szString_0, sizeof(szString_0), "~b~(%d) ~y~%s ~p~QUIT", playerid, getPlayerName(playerid));
- case 2: format(szString_0, sizeof(szString_0), "~b~(%d) ~y~%s ~r~KICK", playerid, getPlayerName(playerid));
- }
- TextDrawSetString(TD_line[0], szString_0);
- TextDrawSetString(TD_line[1], szString_1);
- TextDrawSetString(TD_line[2], szString_2);
- TextDrawSetString(TD_line[3], szString_3);
- TextDrawSetString(TD_line[4], szString_4);
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- TextDrawShowForPlayer(playerid, TD_line[0]);
- TextDrawShowForPlayer(playerid, TD_line[1]);
- TextDrawShowForPlayer(playerid, TD_line[2]);
- TextDrawShowForPlayer(playerid, TD_line[3]);
- TextDrawShowForPlayer(playerid, TD_line[4]);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid)
- {
- TextDrawHideForPlayer(playerid, TD_line[0]);
- TextDrawHideForPlayer(playerid, TD_line[1]);
- TextDrawHideForPlayer(playerid, TD_line[2]);
- TextDrawHideForPlayer(playerid, TD_line[3]);
- TextDrawHideForPlayer(playerid, TD_line[4]);
- return 1;
- }
- stock getPlayerName(playerid)
- {
- new
- szName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, szName, sizeof(szName));
- return szName;
- }
Advertisement
Add Comment
Please, Sign In to add comment