Raised This Month: $ Target: $400
 0% 

split "%i %i"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-18-2010 , 05:41   split "%i %i"
Reply With Quote #1

Hello guys,

I try to split a string
PHP Code:
formatex(data255"%i %i"points[id], healthlevel[id]) 
into "%i" and "%i" so i get the first integer into var1 and the second into var2.

i read something about "parse"...
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-18-2010 , 06:01   Re: split "%i %i"
Reply With Quote #2

Code:
// assuming data has 256 cells and has the data above new str1[8], str2[8] parse( data, str1, 7, str2, 7 ) new var1 = str_to_num( str1 ) new var2 = str_to_num( str2 )
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-18-2010 , 06:17   Re: split "%i %i"
Reply With Quote #3

in the parse line it gives me a "Type missmatch"

here is my full code:

PHP Code:
    new steamid[35]
    new 
string[35]
    
get_user_authid(idsteamid34)
    
formatex(string34"%s"steamid)
    new 
data nvault_get(n_vaultstring)
    
    new 
str1[8], str2[8]
    
parsedatastr17str2)
    
    
points[id] = str_to_num(str1)
    
healthlevel[id] = str_to_num(str2
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-18-2010 , 06:20   Re: split "%i %i"
Reply With Quote #4

data must be a string.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-18-2010 , 06:37   Re: split "%i %i"
Reply With Quote #5

hmm can you help me pls im a noob
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-18-2010 , 06:46   Re: split "%i %i"
Reply With Quote #6

Quote:
Originally Posted by mottzi View Post
PHP Code:
new data nvault_get(n_vaultstring

PHP Code:
new data[32]
nvault_getn_vaultstringdata31 
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ is offline
mottzi
Veteran Member
Join Date: May 2010
Location: Switzerland
Old 07-18-2010 , 06:49   Re: split "%i %i"
Reply With Quote #7

thank you
__________________
Quote:
#define true ((rand() % 2)? true: false) //Happy debugging suckers
mottzi is offline
Send a message via MSN to mottzi
wrecked_
Veteran Member
Join Date: Jan 2010
Location: New York (GMT-5)
Old 07-18-2010 , 07:04   Re: split "%i %i"
Reply With Quote #8

Quote:
Originally Posted by mottzi View Post
thank you
No problem.
__________________
[ Paid Requests ]
DO NOT PM ME ABOUT BLOCKMAKER
NO PRIVATE SUPPORT
wrecked_ 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 07:15.


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