I was looking for plugin, which is - math examples, and who first write right sum *do something*.
But I didn't find.
Code:
Spoiler
PHP Code:
#include <amxmodx>
#define PLUGIN "Math Examples"
#define VERSION "0.1"
#define AUTHOR "chick"
public plugin_init()
{
register_plugin ( PLUGIN, VERSION, AUTHOR )
set_task ( 60.0, "fRandomMath", _, _, _, "b" )
}
public fRandomMath( id )
{
new iRandom = ( random_num(0,1) )
new a
new b
new sum = a+b
new name[ 32 ] = get_user_name ( id )
new authid[ 32 ] = get_user_authid ( id )
if ( iRandom == 0 )
{
a = 2
b = 2
client_print ( id, print_chat, "Math ex: %i + %i", a, b )
/*If ANY PLAYER write right sum as first - in this its 4 -, then do this below*/
{
client_print ( id, print_chat, "%s (%s) write first!", name, authid )
return PLUGIN_HANDLED //End function ?
}
}
if ( iRandom == 1 )
{
a = 1
b = 1
client_print ( id, print_chat, "Math ex: %i + %i", a, b )
/*If ANY PLAYER write right sum as first - in this its 2 -, then do this below*/
{
client_print ( id, print_chat, "%s (%s) write first!", name, authid )
return PLUGIN_HANDLED //End function ?
}
}
return PLUGIN_HANDLED
}
I want to get from client right sum, then do something (in the comments of code explained)
Can you explain me it please?
Last edited by chickez; 07-06-2020 at 10:28.
Reason: solved