Raised This Month: $51 Target: $400
 12% 

String in set_taks param?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 02-22-2012 , 21:36   String in set_taks param?
Reply With Quote #1

Well , i sae a post using.

Code:
EncodeText( const text[] )     return engfunc( EngFunc_AllocString, text )     DecodeText( const text, string[], const length )     global_get( glb_pStringBase, text, string, length )

Exist another method or , only this exists ?
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.

Last edited by lucas_7_94; 02-22-2012 at 21:36.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-22-2012 , 22:07   Re: String in set_taks param?
Reply With Quote #2

Quote:
Originally Posted by lucas_7_94 View Post
Well , i sae a post using.

Code:
EncodeText( const text[] )     return engfunc( EngFunc_AllocString, text )     DecodeText( const text, string[], const length )     global_get( glb_pStringBase, text, string, length )

Exist another method or , only this exists ?
You can pack anything into the array and pass it through set_task().
PHP Code:
new TextData102 ];
TextData] = 1232;
TextData] = copyTextData] , sizeofTextData ) - "this is text" );
set_task1.0 "DecodeText" TextData sizeofTextData ) );


public 
DecodeTextTextData102 ] )
{
    new 
text TextData];
    new 
length TextData];
    
server_print"text=%d string=%s length=%d" text TextData] , length );
    
    
//global_get( glb_pStringBase, text, string, length )

__________________

Last edited by Bugsy; 02-22-2012 at 22:07.
Bugsy is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 02-22-2012 , 22:24   Re: String in set_taks param?
Reply With Quote #3

To understand , why sizeof (TextData ) -2 ? , because i should param 2 strings.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.

Last edited by lucas_7_94; 02-22-2012 at 22:25.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 02-22-2012 , 22:25   Re: String in set_taks param?
Reply With Quote #4

Quote:
Originally Posted by lucas_7_94 View Post
To understand , why sizeof (TextData ) -2 ?
Because the array is sized at 102, with 2 cells to store numerical values and 100 for just the string.

Like this:
[#][#][THIS IS THE STRING ]
__________________
Bugsy 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 00:45.


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