Advertisement
jlalt

zweq111

Jun 1st, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.10 KB | None | 0 0
  1. IRCCMD:setname(botid, channel[], user[], host[], params[]) {
  2.     if (irC_IsHalfop(botid, channel, user)) {
  3.         new Index;
  4.         new tmp[256]; tmp = strtok(params,Index);
  5.         new tmp2[256]; tmp2 = strtok(params,Index);
  6.         if(!strlen(tmp) || !strlen(tmp2)) return IRC_GroupSay(gGroupID,IRC_CHANNEL,"11!setname [ID] [NAME]");
  7.         new player1 = strval(tmp);
  8.         new length = strlen(tmp2);
  9.         new string[128];
  10.         if(!IsPlayerConnected(strval(tmp))) return IRC_GroupSay(gGroupID, IRC_CHANNEL,"11This player is not connected.(Wrong ID)");
  11.         if(length < 3 || length > MAX_PLAYER_NAME) return IRC_GroupSay(gGroupID, IRC_CHANNEL,"11Incorrect name length!");
  12.         new cname[MAX_PLAYER_NAME];
  13.         GetPlayerName(strval(tmp), cname, sizeof(oname));
  14.         format(string,sizeof(string),"11SetName: %s's name has been setted to %s by IRC channel admin '%s'",oname,tmp2,user);
  15.         SetPlayerName(player1, tmp2);
  16.         SendClientMessageToAll(yellow, string);
  17.         return IRC_GroupSay(gGroupID,IRC_CHANNEL, str);
  18.     } else return IRC_GroupSay(gGroupID,IRC_CHANNEL, "4ERROR: You are must be HalfOp to use this command");
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement