Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- forward GetIDFromIp(ip[]);
- new password2[] = "parola2"; //aici schimbi parola
- #define DIALOG_RCON 96
- public OnFilterScriptInit()
- {
- print( "\n[FS] *****************************" );
- print( "[FS] * RCON Protection by Gireada *" );
- print( "[FS] * Loaded ... *" );
- print( "[FS] *******************************\n" );
- }
- public GetIDFromIp(ip[])
- {
- new ip2[16];
- for(new i = 0; i<MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- GetPlayerIp(i, ip2, sizeof(ip2));
- if(strcmp(ip, ip2, true) == 0)
- {
- return i;
- }
- }
- }
- return -1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- if(GetIDFromIp(ip) == -1) printf("[%s] nu este connectat.",ip);
- printf("[%s] a incercat parola %s la RCON", ip, password);
- if(success)
- {
- printf("[%s] a ghicit parola %s la RCON", ip, password);
- ShowPlayerDialog(GetIDFromIp(ip), DIALOG_RCON, DIALOG_STYLE_INPUT, "RCON LOGIN", "Te rugam sa introduci parola2 de la RCON. \n\
- Ai o singura incercare.", "OK", "KICK");
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == DIALOG_RCON)
- {
- if(response)
- {
- if(strcmp(password2, inputtext, true) == 0)
- {
- SendClientMessage(playerid, -1, "Bine ai venit stapane");
- }
- else
- {
- Kick(playerid);
- }
- }
- else
- {
- Kick(playerid);
- }
- return 1;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement