Raised This Month: $ Target: $400
 0% 

RegEx Type Function?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
jim_yang
Veteran Member
Join Date: Aug 2006
Old 01-01-2007 , 08:05   Re: RegEx Type Function?
Reply With Quote #9

FYI, still not good enough.
Code:
#include <amxmodx> #include <amxmisc> #define PLUGIN "Test" #define VERSION "1.0" #define AUTHOR "Jim" #define MAX_STRLEN 32 #define MAX_PLAYER 32 new Player_Steam[MAX_PLAYER][MAX_STRLEN] new  const test_string[3][] = {         "steam:1234567",         "steam:7654321|",         "steam:1234567|steam:7654321|steam:8888888" } public plugin_init() {         register_plugin(PLUGIN, VERSION, AUTHOR)         register_clcmd("test", "test") } public test(id) {         static j         new num = string_split(test_string[j++ % 3])         for(new i = 0; i < num; i++)         {                 client_print(id, print_chat, Player_Steam[i])         }         return PLUGIN_HANDLED } public string_split(const source[]) {         new i, j, k, c         while((c = source[i++]))         {                 if(j == MAX_PLAYER)                         break                                 if(k < MAX_STRLEN && c != '|')                         Player_Steam[j][k++] = c                 else                 {                         Player_Steam[j][k] = 0                         k = 0                         j++                 }         }         return !i ? 0 : (!j ? 1 : (!k ? j : j + 1)) }
doesn't contain the situation of "|steam:1234567"
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>

Last edited by jim_yang; 01-01-2007 at 19:46.
jim_yang 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 22:23.


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