Raised This Month: $ Target: $400
 0% 

[SOLVED]String Sliceing


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-25-2007 , 09:51   [SOLVED]String Sliceing
Reply With Quote #1

Later EDIT: Solved.


Thanks.
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 10-25-2007 at 10:28.
Alka is offline
Podunk
Senior Member
Join Date: Nov 2005
Location: Florida
Old 10-25-2007 , 12:30   Re: [SOLVED]String Sliceing
Reply With Quote #2

share the wealth?
__________________
Check out my website at http://matthewmiller.info
Podunk is offline
Send a message via MSN to Podunk
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 10-25-2007 , 12:33   Re: [SOLVED]String Sliceing
Reply With Quote #3

LOL ?! o_O

Code:
#include <amxmodx>
 
#define PLUGIN "Test Strings"
#define VERSION "1.0"
#define AUTHOR "Alka"
 
#define STR_MAX_NUM 30
#define STR_MAX_SIZE 32
 
new String[STR_MAX_NUM][STR_MAX_SIZE];
new Ips[128];
 
public plugin_init() {
 
 register_plugin(PLUGIN, VERSION, AUTHOR);
 
 register_cvar("ipslist", "12.22.222.23:27015;13.22.222.23:27015;14.22.222.23:27015;");
 
 get_cvar_string("ipslist", Ips, sizeof Ips - 1);
 
 new Num;
 
 do {
  Num++;
  
  strtok(Ips, String[Num], sizeof String - 1, Ips, sizeof Ips - 1, ';');
  
 } while(containi(Ips, ";") != -1);
 
 for(new i = 0 ; i < sizeof String ; i++)
 {
  if(!String[i][0])
   continue;
  
  new Ip[32], Port[10];
  strtok(String[i], Ip, sizeof Ip - 1, Port, sizeof Port - 1, ':');
  
  server_print("Debug: Ip: %s | Port: %s", Ip, Port);
 }
}
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Reply


Thread Tools
Display Modes

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 01:21.


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