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