I tried many ways of retrieving strings using dynamic natives but i failed this is the main plugin that i was using:
Code:
#include <amxmodx>
#include <amxmisc>
public plugin_natives()
{
register_native("get_persons_name", "_get_persons_name", 1)
}
public _get_persons_name(plugin, paramsnum)
{
// No parameters passed
if(!paramsnum)
return -1
new name[32]
get_user_name(get_param(1), name, 30)
set_string(2, name, get_param(3))
return 1
}
sub plugin looks like this
i use the native to retrieve a persons name [Its just for testing purposes]
Code:
#include <amxmodx>
#include <amxmisc>
#include < name >
public plugin_init()
{
// Plugin registeration
register_plugin("-New","1.0","@bdul!")
register_clcmd("say test", "hook")
}
public hook(id)
{
new name[32]
get_persons_name(id, name, charsmax(name))
client_print( id, print_chat, "******* Your Name : %s", name)
}
Include file looks like this:
PHP Code:
#if defined _name_included
#endinput
#endif
#define _name_included
native get_persons_name( id, const string[], len )
The Problem:
When i type test for checking i get this stupid run-time error:
PHP Code:
L 07/11/2010 - 23:27:57: Wrong style of dynamic native
L 07/11/2010 - 23:27:57: [AMXX] Run time error 10 (plugin "example.amxx") (native "get_param") - debug not enabled!
L 07/11/2010 - 23:27:57: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
L 07/11/2010 - 23:27:57: Unhandled dynamic native error
L 07/11/2010 - 23:27:57: [AMXX] Run time error 10 (plugin "working.amxx") (native "get_persons_name") - debug not enabled!
L 07/11/2010 - 23:27:57: [AMXX] To enable debug mode, add "debug" after the plugin name in plugins.ini (without quotes).
I dont know why these errors are occuring and due to this the native is not performing what it is supposed to do
So if please some one can help me then it would be great
Thnx in advance....
__________________