Raised This Month: $ Target: $400
 0% 

String Help?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 01-04-2008 , 04:48   Re: String Help?
Reply With Quote #6

Here...i've tested it, and works, but one little thing...read the comment at String[] :s

Code:
public plugin_cfg() //You can use your_func, i've used this for debug. :)
{
 //Size 10, length 10 x).
 new Array[10][10];
 
 //Hmm, some odd thing, you must have an "." after last
 //number to store it in array. Shity strotk.
 //Or you can let it without "." at the end, and check the Sttring too after array.
 new String[] = "1.5.15.64.34.";
 
 new Num;
 while(containi(String, ".") != -1)
 {
  strtok(String, Array[Num], sizeof Array[] - 1, String, sizeof String - 1, '.');
 
  Num++;
 }
 
 for(new i = 0 ; i < sizeof Array ; i++)
 {
  //Magic skip.
  if(!Array[i][0])
   continue;
 
  //Degug thing.
  server_print("DEBUG: Array[%d] = %d", i, str_to_num(Array[i]));
 
  //This is the magic trick.
  if(containi(Array[i], "15") != -1) //Can use equal/i too. :p
   server_print("DEBUG: Array[%d] matched with value %d", i, str_to_num(Array[i]));
 }
}
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 01-04-2008 at 04:56.
Alka 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 11:13.


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