Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include a_samp
- #include file
- new File:RFile[2];
- public OnFilterScriptInit() {
- RFile[0] = fopen("rcons.txt", io_readwrite);
- RFile[1] = fopen("frcons.txt", io_readwrite);
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- new playerip[15 + 1];
- for(new playerid = 0, highestPlayerid = GetPlayerPoolSize(); playerid <= highestPlayerid; playerid++) {
- if(IsPlayerConnected(playerid) && !IsPlayerNPC(playerid)) {
- GetPlayerIp(playerid, playerip, sizeof(playerip));
- if(!strcmp(ip, playerip, true)) {
- if(success) {
- new pName[32], string[128];
- GetPlayerName(playerid,pName,sizeof pName);
- format( string, sizeof(string), "Successful login Player %s | Player IP %s | Password used %s |", pName, ip, password);
- fwrite(RFile[0], string);
- return 1;
- } else {
- new pName[32], string[128];
- GetPlayerName(playerid,pName,sizeof pName);
- format(string, sizeof string, "Fail Rcon Login by Player %s | Player IP %s | Password Used %s", pName, ip, password);
- fwrite(RFile[1], string);
- }
- break;
- }
- }
- }
- return 1;
- }
- public OnFilterScriptExit() {
- fclose(RFile[0]);
- fclose(RFile[1]);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment