Hello ,here is the mainplugin,like this:
LoginSystem.inc
PHP Code:
#pragma reqlib "LoginSystem"
/*
user access type
*/
enum
{
MT_UNLOGIN = 0, // unRegister
MT_NORMAL = 1, // Normal player
MT_VIP1 = 2, // vip1
MT_VIP2 = 3, // vip2
MT_VIP3 = 4, // vip3
MT_OP = 5 // OP
};
/*
export function
*/
native get_user_type(id)
LoginSystem.sma
when call the client_connect(id), I will find the access type from the mysql ,then call client_text_color said :"Hello ,welcome [vip1] name !"....
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <LoginSystem.inc>
/*****************************************************************
enum
{
MT_UNLOGIN = 0, // unRegister
MT_NORMAL = 1, // Normal player
MT_VIP1 = 1, // vip1
MT_VIP2 = 2, // vip2
MT_VIP3 = 3, // vip3
MT_OP = 4 // OP
};
*****************************************************************/
new userType[33]
public plugin_init()
{
register_plugin(PLUGIN_NAME, VERSION, AUTHOR)
}
public plugin_natives()
{
register_library("LoginSystem")
register_native("get_user_type","_get_user_type")
}
public _get_user_type(id)
{
new type = userType[id]
client_print(id,print_console,"get id= %d, get type = %d",id,type)
return type
}
and then , I use the function in other sma files:
get_user_type(id) , it also return 0.(unRegister)
But in LoginSystem.sma, it normal show vip1 or vip2 and more.
I find this note:
[TUT] Dynamic / Fake Natives
and I carefully contrast this, is all the same way.
why isn't right?
__________________