Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:zmiennick (ply, cmd[]) {
- if (!cmd[0] || cmd[0] == '\1' && cmd[1] == '\0') return SendClientMessage (ply, -1, "Uzyj: /zmiennick <nowy nick>");
- if (!(3 <= strlen (cmd) < 21)) return SendClientMessage (ply, -1, "Dlugosc nicku nie moze przekraczac od 3 do 21 znakow.");
- new bool:stop = false;
- for (new i, j = strlen (cmd); i < j; i++) {
- switch (cmd[i]) {
- case 'a'..'z': continue;
- case 'A'..'Z': continue;
- case '0'..'9': continue;
- case '.', '=', '$', '[', ']', '(', ')', '@', '_': continue;
- default: {
- stop = true;
- break;
- }
- }
- }
- if (!stop) {
- new buf[80];
- format (buf, sizeof (buf), "Zmieniles nick na %s.", cmd);
- SendClientMessage (ply, -1, buf);
- } else SendClientMessage (ply, -1, "Nick zawiera nieprawidlowe znaki.");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment