 |
|
Junior Member
Join Date: Jun 2020
Location: Slovakia
|

07-05-2020
, 03:58
Re: Math and get integer from clcmd "say"
|
#2
|
I changed code a little.
Spoiler
PHP Code:
#include <amxmodx>
#define PLUGIN "Math Examples"
#define VERSION "0.1"
#define AUTHOR "chick"
public plugin_init ( )
{
register_plugin ( PLUGIN, VERSION, AUTHOR )
register_clcmd ( "say", "fMath" )
register_clcmd ( "say_team", "fMath" )
}
public fMath ( id )
{
new a = random_num ( 0, 50 )
new b = random_num ( 0, 50 )
new sum = a+b
client_print ( id, print_chat, "Math example: %i + %i", a, b )
new Arg1 [ 4 ]
read_argv ( id, Arg1, charsmax(Arg1) )
str_to_num ( Arg1 )
if ( equali(Arg1, sum) )
client_print ( id, print_chat, "You're right!" )
return PLUGIN_HANDLED
}
This doesn't work. Error:
Code:
Error: Argument type mismatch (argument 2) on line 29
Warning: Symbol is assigned a value that is never used: "sum" on line 33
What's wrong? Why it doesn't get the sum?
|
|
|
|