I assumed you were doing this for zombie mod or whatever and got the native to search for a zombie. Feel free to replace the search function with whatever you need to get.
Code:
native get_zombie_name( name[], len )
/* Usage:
new name[32]
get_zombie_name( name, 31 ) */
public plugin_natives()
{
register_native( "get_zombie_name", "NativeGetZombieName" )
}
public NativeGetZombieName( plugin, paramsnum )
{
if( !paramsnum )
{
return PLUGIN_CONTINUE;
}
new id
new iPlayers[32]
new iNum
get_players( iPlayers, iNum )
// search for your player or whatever
// store the id for the zombie in id
for( new i = 0; i < iNum; i++ )
{
if( zp_get_user_zombie( iPlayers[i] ) )
{
id = iPlayers[i]
break;
}
}
new name[32]
get_user_name( id, name, 31 )
set_string( 1, name, get_param( 2 ) )
return PLUGIN_CONTINUE;
}
__________________