Guest User

Untitled

a guest
Mar 5th, 2013
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. CMD:zmiennick (ply, cmd[]) {
  2. if (!cmd[0] || cmd[0] == '\1' && cmd[1] == '\0') return SendClientMessage (ply, -1, "Uzyj: /zmiennick <nowy nick>");
  3. if (!(3 <= strlen (cmd) < 21)) return SendClientMessage (ply, -1, "Dlugosc nicku nie moze przekraczac od 3 do 21 znakow.");
  4.  
  5. new bool:stop = false;
  6. for (new i, j = strlen (cmd); i < j; i++) {
  7. switch (cmd[i]) {
  8. case 'a'..'z': continue;
  9. case 'A'..'Z': continue;
  10. case '0'..'9': continue;
  11. case '.', '=', '$', '[', ']', '(', ')', '@', '_': continue;
  12. default: {
  13. stop = true;
  14. break;
  15. }
  16. }
  17. }
  18. if (!stop) {
  19. new buf[80];
  20. format (buf, sizeof (buf), "Zmieniles nick na %s.", cmd);
  21. SendClientMessage (ply, -1, buf);
  22. } else SendClientMessage (ply, -1, "Nick zawiera nieprawidlowe znaki.");
  23. return 1;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment