Guest User

Untitled

a guest
Jan 4th, 2011
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. #include <a_samp>
  2. #include <dini>
  3.  
  4. enum pInfo
  5. {
  6. pLogged,
  7. pAdminLevel
  8. }
  9.  
  10. new PlayerInfo[MAX_PLAYERS][pInfo];
  11. new level[MAX_PLAYERS];
  12. new Muted[MAX_PLAYERS];
  13. //Forwards
  14. forward MessageToAdmins(color, const string[]);
  15. //Anti Warning
  16. #pragma unused strtok
  17. #pragma unused ret_memcpy
  18.  
  19. public OnPlayerConnect(playerid)
  20. {
  21. PlayerInfo[playerid][pLogged] = 1;
  22. new pname[MAX_PLAYER_NAME], string[180];
  23. GetPlayerName(playerid, pname, sizeof(pname));
  24. format(string, sizeof(string), "%s has connected to the server",pname);
  25. MessageToAdmins(Grey, string);
  26. new playerfile[100];
  27. GetPlayerName(playerid, pname, sizeof(pname));
  28. format(playerfile, sizeof(playerfile), "Reg/Users/%s.ini",pname);
  29. if (!dini_Exists(playerfile)) SendClientMessage(playerid, White, "%s not found register your account");
  30. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_INPUT, "Register your account", "Enter a password", "Register", "Quit");
  31. if(dini_Exists(playerfile)) SendClientMessage(playerid, Green, "%s is registered login to your acccount");
  32. ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Login to your account", "Enter your password", "Login", "Quit");
  33. return 1;
  34. }
  35.  
  36. public OnPlayerDisconnect(playerid, reason)
  37. {
  38. if(PlayerInfo[playerid][pLogged] == 1)
  39. {
  40. new playerfile[100], pname[MAX_PLAYER_NAME];
  41. GetPlayerName(playerid, pname, sizeof(pname));
  42. format(playerfile, sizeof(playerfile), "Reg/Users/%s.ini",pname);
  43. }
  44. Muted[playerid] = 0;
  45. new string[180], pname[MAX_PLAYER_NAME];
  46. GetPlayerName(playerid, pname, sizeof(pname));
  47. format(string, sizeof(string), "%s has left the server.",pname);
  48. MessageToAdmins(Grey, string);
  49. return 1;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment