Try
Remove:
public plugin_natives()
register_native( "get_player_timeplayed", "get_player_timeplayed", 1 );
native get_player_timeplayed( SteamID );
use to get the native registered in another plugin
main plugin:
PHP Code:
public plugin_natives()
register_native( "get_player_timeplayed", "get_player_timeplayed", 1 );
public get_player_timeplayed( steamid2[] )
{
new steamid3[ 32 ];
formatex( steamid3, charsmax( steamid3 ), "%s", steamid2 );
new SteamID[ 32 ], TimeLength;
for( new i = 0; i < ArraySize( g_iTimePlayer ); i++ )
{
ArrayGetString( g_iTimePlayer, i, SteamID, charsmax( SteamID ) );
TrieGetCell( g_iTimeLength, SteamID, TimeLength );
if( equali( steamid2, SteamID ) || equali( steamid3, SteamID ) )
return TimeLength;
}
return 0;
}
secondary plugin
PHP Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
native get_player_timeplayed( SteamID );
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /test","test")
}
public test(id)
{
new played = get_player_timeplayed( SteamID );
// function
}