Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <dini>
- enum pInfo
- {
- pLogged,
- pAdminLevel
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- new level[MAX_PLAYERS];
- new Muted[MAX_PLAYERS];
- //Forwards
- forward MessageToAdmins(color, const string[]);
- //Anti Warning
- #pragma unused strtok
- #pragma unused ret_memcpy
- public OnPlayerConnect(playerid)
- {
- PlayerInfo[playerid][pLogged] = 1;
- new pname[MAX_PLAYER_NAME], string[180];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "%s has connected to the server",pname);
- MessageToAdmins(Grey, string);
- new playerfile[100];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(playerfile, sizeof(playerfile), "Reg/Users/%s.ini",pname);
- if (!dini_Exists(playerfile)) SendClientMessage(playerid, White, "%s not found register your account");
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register your account", "Enter a password", "Register", "Quit");
- if(dini_Exists(playerfile)) SendClientMessage(playerid, Green, "%s is registered login to your acccount");
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login to your account", "Enter your password", "Login", "Quit");
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- if(PlayerInfo[playerid][pLogged] == 1)
- {
- new playerfile[100], pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(playerfile, sizeof(playerfile), "Reg/Users/%s.ini",pname);
- }
- Muted[playerid] = 0;
- new string[180], pname[MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- format(string, sizeof(string), "%s has left the server.",pname);
- MessageToAdmins(Grey, string);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment