Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // FilterScript with Connect / Disconnect textdraw system made by 'NoLife' on 07/01/2019.
- #include <a_samp>
- //==============================================================================
- #if defined FILTERSCRIPT
- #define FILTERSCRIPT
- //==============================================================================
- // Textdraws
- new Text:ConnectDisconnectTD, TextDrawStr[3][500*3];
- //==============================================================================
- public OnGameModeInit() {
- ConnectDisconnectTD = TextDrawCreate(260.560607, 399.999969, "_");
- TextDrawLetterSize(ConnectDisconnectTD, 0.230730, 1.279165);
- TextDrawColor(ConnectDisconnectTD, -1);
- TextDrawSetShadow(ConnectDisconnectTD, 1);
- TextDrawSetOutline(ConnectDisconnectTD, 0);
- TextDrawBackgroundColor(ConnectDisconnectTD, 255);
- TextDrawFont(ConnectDisconnectTD, 1);
- TextDrawSetProportional(ConnectDisconnectTD, 1);
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid) {
- TextDrawHideForPlayer(playerid, ConnectDisconnectTD);
- return 1;
- }
- public OnPlayerSpawn(playerid) {
- TextDrawShowForPlayer(playerid, ConnectDisconnectTD);
- return 1;
- }
- public OnPlayerConnect(playerid) {
- PlayerConnected(playerid);
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason) {
- PlayerDisconnected(playerid, reason);
- return 1;
- }
- //==============================================================================
- // Stocks
- stock PlayerConnected(playerid) //You cand find this on OnPlayerConnect(playerid)
- {
- if(strlen(TextDrawStr[0]) < 5)
- {
- new rands = random(3);
- switch(rands)
- {
- case 0: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~g~~h~~h~has joined the server!", PlayerName(playerid), playerid);
- case 1: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~b~~h~~h~has joined the server!", PlayerName(playerid), playerid);
- case 2: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~p~~h~~h~has joined the server!", PlayerName(playerid), playerid);
- }
- }
- else
- {
- format(TextDrawStr[2], 256*3, "%s", TextDrawStr[1]);
- format(TextDrawStr[1], 256*3, "%s", TextDrawStr[0]);
- new rands2 = random(3);
- switch(rands2)
- {
- case 0: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~g~~h~~h~has joined the server!", PlayerName(playerid), playerid);
- case 1: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~b~~h~~h~has joined the server!", PlayerName(playerid), playerid);
- case 2: format(TextDrawStr[0], 256*3, "~g~~h~%s~r~~h~(%d) ~p~~h~~h~has joined the server!", PlayerName(playerid), playerid);
- }
- }
- new str[256*3];
- format(str, sizeof(str), "~n~%s~n~%s~n~%s", TextDrawStr[0], TextDrawStr[1], TextDrawStr[2]);
- TextDrawSetString(ConnectDisconnectTD, str), TextDrawShowForAll(ConnectDisconnectTD); return 1;
- }
- stock PlayerDisconnected(playerid, reasonid) //You cand find this on OnPlayerDisconnect(playerid)
- {
- new ReasonOfExit[30];
- switch(reasonid)
- {
- case 0: ReasonOfExit = "Timeout"; case 1: ReasonOfExit = "Leaving"; case 2: ReasonOfExit = "Kicked/Banned";
- }
- if(strlen(TextDrawStr[0]) < 5)
- {
- format(TextDrawStr[0], 256*3, "~r~~h~%s(%d) ~g~~h~has left the server! ~r~~h~(%s)", PlayerName(playerid), playerid, ReasonOfExit);
- }
- else
- {
- format(TextDrawStr[2], 256*3, "%s", TextDrawStr[1]);
- format(TextDrawStr[1], 256*3, "%s", TextDrawStr[0]);
- format(TextDrawStr[0], 256*3, "~r~~h~%s(%d) ~g~~h~~h~has left the server! ~r~~h~(%s)", PlayerName(playerid), playerid, ReasonOfExit);
- }
- new str[256*3];
- format(str, sizeof(str), "~n~%s~n~%s~n~%s", TextDrawStr[0], TextDrawStr[1], TextDrawStr[2]);
- TextDrawSetString(ConnectDisconnectTD, str), TextDrawShowForAll(ConnectDisconnectTD); return 1;
- }
- // FilterScript with Connect / Disconnect textdraw system made by 'NoLife' on 07/01/2019
- // End of script
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement