Raised This Month: $ Target: $400
 0% 

Retrieving strings by using fake/dynamic natives


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 06-22-2010 , 11:48   Re: Retrieving strings by using fake/dynamic natives
Reply With Quote #1

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; }
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 06-22-2010 , 14:02   Re: Retrieving strings by using fake/dynamic natives
Reply With Quote #2

Quote:
Originally Posted by wrecked_ View Post
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.
@wrecked_ : Can you give me a description about what this function performs.:
PHP Code:
set_string1nameget_param) ) 
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 06-22-2010 , 14:26   Re: Retrieving strings by using fake/dynamic natives
Reply With Quote #3

Quote:
Originally Posted by abdul-rehman View Post
@wrecked_ : Can you give me a description about what this function performs.:
PHP Code:
set_string1nameget_param) ) 
That sets the first native parameter (the string you pass when calling the function) to 'name'. It then uses the len you provide as the second native parameter.

set_string( destparam, string[], len )
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 14:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode