The scripts instructions for the plugin explain a lot. ****** can show some more.
Should only use authenticated users from IRC for chatting otherwise someone could just join and spam. |
IRCCMD:pm(botid, channel[], user[], host[], params[]) { new userid, message[119], string[128]; if(sscanf(params, "us", userid, message)) return 0; // Return a message here using IRC_Say, this checks whether the parameters are filled if(!IsPlayerConnected(userid)) return 0; // Return a message here using IRC_Say, this checks whether a user is connected or not if(strlen(message) > 118) return 0; // Return a message using IRC_Say (Ensures the maximum amount of characters has not been reached) /* The string length is 118 because if a user has 9 characters in their name on the irc, and the message reaches all of the string length it will cut it off at the end because it can not show more than 128 characters at once. */ format(string, sizeof(string), "%s: %s", user, message); SendClientMessage(userid, 0xFFFFFF, string); // Use IRC_Say to inform the user about the successfully sent message, example: IRC_Say(botid, user, "Successfully sent a PM!"); return 1; }
if(!IRC_IsVoice(botid, channel, user)) return 0; // This can be used to check if the user has voice in the server, if the user does not have voice then they can not use the command