Code:
#include <amxmodx>
#include <amxmisc>
public plugin_init() {
register_plugin("Say", "1.0", "PurposeLess")
register_clcmd("say", "clcmd_say")
register_clcmd("say_team", "clcmd_say")
}
// I didn't change anything above here, it's all good.
public clcmd_say(id) {
new text[32] // This is big enough to hold the message with some extra space for flexibility.
read_args(text, charsmax(text)) // Read the contents of the message.
remove_quotes(text) // Remove the quotes.
new command[16], number[16] // New variables to hold the different parts.
strbreak(text, command, charsmax(command), number, charsmax(number)) // Split the text in two using space as a delimiter.
if ( equali(command, "/referral") ) { // Check if the command is correct.
new uid = str_to_num(number) // Convert the number string to an integer
if ( uid ) // You need to check that the uid is actually a number and not 0.
client_print(id, print_chat, "Referral UID: %d", uid)
}
}
__________________