added belsebub's test
This commit is contained in:
parent
63ec26f8c0
commit
1088b209d9
39
plugins/testsuite/fwdtest1.sma
Normal file
39
plugins/testsuite/fwdtest1.sma
Normal file
|
@ -0,0 +1,39 @@
|
||||||
|
#include <amxmodx>
|
||||||
|
|
||||||
|
new g_forward
|
||||||
|
new g_id
|
||||||
|
|
||||||
|
public plugin_init()
|
||||||
|
{
|
||||||
|
g_id = register_plugin("Foward Test (Master)", "1.0", "Belsebub")
|
||||||
|
}
|
||||||
|
|
||||||
|
public plugin_natives()
|
||||||
|
{
|
||||||
|
register_native("test_createforward", "test_createforward_handler")
|
||||||
|
register_native("test_executeforward", "test_executeforward_handler")
|
||||||
|
}
|
||||||
|
|
||||||
|
//test_createforward(function[])
|
||||||
|
public test_createforward_handler(pluginid, numparams)
|
||||||
|
{
|
||||||
|
server_print("(test_createforward_handler: %d,%d)", pluginid, numparams)
|
||||||
|
|
||||||
|
new function[32]
|
||||||
|
get_string(1, function, 31)
|
||||||
|
|
||||||
|
g_forward = CreateOneForward(pluginid, function)
|
||||||
|
}
|
||||||
|
|
||||||
|
//test_executeforward()
|
||||||
|
public test_executeforward_handler(pluginid, numparams)
|
||||||
|
{
|
||||||
|
new retval
|
||||||
|
|
||||||
|
server_print("(test_executeforward_handler: %d,%d)", pluginid, numparams)
|
||||||
|
|
||||||
|
if (!ExecuteForward(g_forward, retval))
|
||||||
|
{
|
||||||
|
server_print("failed to execute forward (I'm %d)", g_id)
|
||||||
|
}
|
||||||
|
}
|
25
plugins/testsuite/fwdtest2.sma
Normal file
25
plugins/testsuite/fwdtest2.sma
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
#include <amxmodx>
|
||||||
|
|
||||||
|
new g_id
|
||||||
|
|
||||||
|
native test_createforward(function[])
|
||||||
|
native test_executeforward()
|
||||||
|
|
||||||
|
public plugin_init()
|
||||||
|
{
|
||||||
|
g_id = register_plugin("Forward Test (Client)", "1.0", "Belsebub")
|
||||||
|
|
||||||
|
register_srvcmd("fwd_test1", "Test_Forward1")
|
||||||
|
}
|
||||||
|
|
||||||
|
public Test_Forward1()
|
||||||
|
{
|
||||||
|
server_print("Executing forward ^"gaben^" (I'm %d)", g_id)
|
||||||
|
test_createforward("gaben")
|
||||||
|
test_executeforward()
|
||||||
|
}
|
||||||
|
|
||||||
|
public gaben()
|
||||||
|
{
|
||||||
|
server_print("gaben executed (I'm %d)", g_id)
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user