AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [SOLVED]String Sliceing (https://forums.alliedmods.net/showthread.php?t=62364)

Alka 10-25-2007 09:51

[SOLVED]String Sliceing
 
Later EDIT: Solved.


Thanks.

Podunk 10-25-2007 12:30

Re: [SOLVED]String Sliceing
 
share the wealth?

Alka 10-25-2007 12:33

Re: [SOLVED]String Sliceing
 
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);
 }
}



All times are GMT -4. The time now is 01:21.

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