Тhat was clear and helpfull enough, big thanks! I also removed that float() tag from the stock-calling in the float_to_string native, it was useless.
Here is the redacted code, if someone is interested.
PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#define PLUGIN "Algorhytm"
#define VERSION "1.0"
#define AUTHOR "Flicker"
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd ("say","Say")
register_clcmd ("say_team","Say")
}
public Say(id)
{
new args[129], command[11], arg2[32]
read_args(args, charsmax(args))
remove_quotes(args)
parse(args, command, charsmax(command), arg2, charsmax(arg2))
new parameter = str_to_num(arg2)
if(equali(command, "/calculate"))
{
if(!parameter)
{
client_print(id, print_chat, "You should add some value of X to calculate")
return PLUGIN_HANDLED
}
new value[32]
float_to_str(calculation(float(parameter)), value, charsmax(value))
client_print(id, print_chat, "Your result is %s", value)
}
return PLUGIN_CONTINUE
}
stock Float:calculation(const Float:x)
{
new Float:Result
if(x > 1)
Result = 3 / (x - 1)
else if(x == 1)
Result = x * 0
else if(x < 1)
Result = (4 * x * x) - 2
return Result
}
Black Rose, saving good noobs again!
__________________