Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <YSI\y_iterate>
- static PlayerIP[MAX_PLAYERS];
- public OnPlayerConnect(playerid)
- {
- new IP[32];
- GetPlayerIp(playerid, IP, sizeof(IP));
- PlayerIP[playerid] = '\0';
- strins(PlayerIP, IP, 0);
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- foreach(new i: Player)
- {
- new IP[32];
- GetPlayerIp(i, IP, sizeof(IP));
- if(!strcmp(IP, ip))
- {
- CallLocalFunction("OnPlayerRconLogin", "dsi", i, password, success);
- }
- }
- return 1;
- }
- #if defined _ALS_OnPlayerConnect
- #undef OnPlayerConnect
- #else
- #define _ALS_OnPlayerConnect
- #endif
- #define OnPlayerConnect RCON_OnPlayerConnect
- #if defined _ALS_OnRconLoginAttempt
- #undef OnRconLoginAttempt
- #else
- #define _ALS_OnRconLoginAttempt
- #endif
- #define OnRconLoginAttempt RCON_OnRconLoginAttempt
- forward OnPlayerRconLogin(playerid, password[], success);
- /* Example/Ejemplo:
- public OnPlayerRconLogin(playerid, password[], success)
- {
- new string[144];
- new Nick[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Nick, sizeof(Nick));
- format(string, sizeof(string), "* %s[%d] %s he identified as administrator. [Pass: %s].", Nick, playerid, success ? ("yes") : ("not"), password);
- SendClientMessageToAll(-1, string);
- return 1;
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement