Raised This Month: $ Target: $400
 0% 

Hook Saytext Help


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 09-16-2013 , 15:42   Re: Hook Saytext Help
Reply With Quote #2

There's no practical use for the code that would be needed to do these things.
Therefor you should ask what you really need.
(Use formatex instead of format)

Code:
#include <amxmodx> public plugin_init() {     register_plugin("Test Plugin 6", "", "");         new string[10] = "hello";     new string2[20];         for ( new i = 0 ; string[i] && i * 2 + 1 < charsmax(string2) ; i++ ) {         string2[i * 2] = '|';         string2[i * 2 + 1] = string[i];     }     string2[strlen(string2)] = '|';         server_print("string: %s^nstring2: %s", string, string2); }

Code:
#include <amxmodx> public plugin_init() {     register_plugin("Test Plugin 6", "", "");         new string[10] = "hello";     new string2[20];         for ( new i = 0, o = 0 ; string[i] && o + 1 < charsmax(string2) ; i++, o += 2 ) {         string2[o] = '|';         string2[o + 1] = string[i];     }     string2[strlen(string2)] = '|';         server_print("string: %s^nstring2: %s", string, string2); }

Code:
string: hello
string2: |h|e|l|l|o|
Code:
#include <amxmodx> public plugin_init() {     register_plugin("Test Plugin 6", "", "");         new string[20] = "hey how are you";     new string2[40] = "|";         for ( new i = 0, o = 1 ; string[i] && o + 1 < charsmax(string2) ; i++, o++ ) {         string2[o] = string[i];         if ( string[i] == ' ' )             string2[++o] = '|';     }         server_print("string: %s^nstring2: %s", string, string2); }

Code:
string: hey how are you
string2: |hey |how |are |you
__________________

Last edited by Black Rose; 09-16-2013 at 15:44.
Black Rose is offline
 



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 19:02.


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