Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // By Champ
- #define FILTERSCRIPT
- #include <a_samp>
- // ******************** DEFINES *****************
- #define SecondaryRconPass "changeme2"
- #define DIALOG_TYPE_SecondaryRcon 2013
- // **********************************************
- // ***** VARIABLES *******
- new Attempts[MAX_PLAYERS];
- // ***********************
- //*********************************************************
- // __ __
- // / / / / / /
- // (___ ___ ___ ___ (___ (___ (___ ___ ___ (___
- // )| | )| | )| )| | )| )|
- // __/ |__ | | |__/ |__ __/ |__ |__/|| |__
- // |
- //*********************************************************
- #if defined FILTERSCRIPT
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" C' Rcon Security Essential - Loaded");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n--------------------------------------");
- print(" C' Rcon Security Essential - UnLoaded");
- print("--------------------------------------\n");
- return 1;
- }
- #endif
- public OnRconLoginAttempt(ip[], password[], success)
- {
- if(success)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- new pIP[16];
- GetPlayerIp(i, pIP, 16);
- if(!strcmp(pIP,ip,true))
- {
- new string[128];
- format(string,sizeof(string),"This Server Uses Rcon Security Essential by Champ.\n Please Enther the Secondary Rcon Password below.");
- ShowPlayerDialog(i, DIALOG_TYPE_SecondaryRcon, DIALOG_STYLE_INPUT,"C' Rcon Security Essential",string, "Enter", "Exit");
- }
- }
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_TYPE_SecondaryRcon)
- {
- if (response)
- {
- if (!strcmp(SecondaryRconPass, inputtext) && !(!strlen(inputtext)))
- {
- GameTextForPlayer(playerid, "~g~ Rcon ~w~ Authorized !",3000,3);
- }
- else
- {
- if(Attempts[playerid] == 3)
- {
- SendClientMessage(playerid, 0xFF0000AA, "You are kicked for entering wrong Secondary Rcon Password");
- Kick(playerid);
- }
- Attempts[playerid] ++;
- new tmp[140];
- SendClientMessage(playerid, 0xFF0000AA, "|- Invalid Rcon Password! -|");
- format(tmp,sizeof(tmp),"Invalid Password!. \nEnter the correct Rcon Password!\n\nAttempts: %d/3", Attempts[playerid]);
- ShowPlayerDialog(playerid, DIALOG_TYPE_SecondaryRcon, DIALOG_STYLE_INPUT, "C' Rcon Security Essential",tmp, "Enter", "Exit");
- }
- }
- else
- {
- SendClientMessage(playerid, 0xFF0000AA, "Kicked!");
- return Kick(playerid);
- }
- }
- return 1;
- }
- //*************************************************
- // __ __
- // / / / / |
- // (___ ___ ___ ___ (___ (___ ___ ___|
- // )| | )| | )| | | )| )
- // __/ |__ | | |__/ |__ |__ | / |__/
- // |
- //*************************************************
Advertisement
Add Comment
Please, Sign In to add comment