legodude

legodude

Jul 2nd, 2010
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.11 KB | None | 0 0
  1. #define PASS_MIN 2//change the numbers to ur own
  2. #define PASS_MAX 15
  3.  
  4. dcmd_register(playerid, params[])
  5. {
  6. if(gPlayerInfo[playerid][PLAYER_REGGED] == 1)
  7. return SendClientMessage(playerid, COLOUR_ORANGE, "ERROR: You have already registered!");
  8. else if(!params[0])
  9. return SendClientMessage(playerid, COLOUR_ORANGE, "USAGE: /register [password]");
  10. else if(strlen(params) < gSettings[PASS_MIN] || strlen(params) > gSettings[PASS_MAX])
  11. {
  12. new string[200];
  13. format(string, sizeof(string), "ERROR: Password must be between %d and %d characters long!", gSettings[PASS_MIN], gSettings[PASS_MAX]);
  14. return SendClientMessage(playerid, COLOUR_ORANGE, string);
  15. }
  16. else
  17. {
  18. new password = num_hash(params);
  19. gPlayerInfo[playerid][PLAYER_PASS] = password;
  20. gPlayerInfo[playerid][PLAYER_REGGED] = 1;
  21. gPlayerInfo[playerid][PLAYER_LOGGED] = 1;
  22. GetPlayerIp(playerid, gPlayerInfo[playerid][PLAYER_IP], 16);
  23. new string[256]; format(string, sizeof(string), "You have successfully registered your account with the password \'%s\'. You have been automatically logged in.", params);
  24. return SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
  25. }
  26. }
Add Comment
Please, Sign In to add comment