b0ss

Untitled

Aug 23rd, 2012
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. COMMAND:register(playerid, params[])
  2. {
  3. MysqlCheck();
  4. if(sscanf(params, "ss", params,params[0])) return SendClientMessage(playerid, COLOR_RED, "Command Usage: /register [password] ");
  5. if(DoesUserExist(playerid)) return SendClientMessage(playerid,COLOR_RED,"You are all ready registered!");
  6. if(strfind(params, " ", true) != -1) return SendClientMessage(playerid,COLOR_RED,"Invalid Character!" );
  7. if(strlen(params) > 14)return SendClientMessage(playerid,COLOR_RED,"Password is invalid! No longer than 14 characters please!");
  8. if(strlen(params) < 6)return SendClientMessage(playerid,COLOR_RED,"Password is invalid! No shorter than 6 characters please!");
  9. if(!CanRegister[playerid])return SendClientMessage(playerid,COLOR_RED,"You can't register until you accept the agreement!");
  10. format(string, 256, "You succesfully registered the nickname %s with password %s", PlayerName(playerid), params);
  11. SendClientMessage(playerid, COLOR_YELLOW, string);
  12. WP_Hash(string, sizeof (string),params);
  13. RegisterPlayer(playerid,string);
  14. PlayerInfo[playerid][pLogged] = 1;
  15. SendClientMessage(playerid, COLOR_YELLOW, "You have been automatically logged in!");
  16. SendClientMessage(playerid,announceblue,"One thing: please report all crashes or bugs to http://stunique.net/forum!");
  17. return 1;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment