AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   split "%i %i" (https://forums.alliedmods.net/showthread.php?t=132709)

mottzi 07-18-2010 05:41

split "%i %i"
 
Hello guys,

I try to split a string
PHP Code:

formatex(data255"%i %i"points[id], healthlevel[id]) 

into :arrow: "%i" and "%i" so i get the first integer into var1 and the second into var2.

i read something about "parse"...

wrecked_ 07-18-2010 06:01

Re: split "%i %i"
 
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 )

mottzi 07-18-2010 06:17

Re: split "%i %i"
 
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


wrecked_ 07-18-2010 06:20

Re: split "%i %i"
 
data must be a string.

mottzi 07-18-2010 06:37

Re: split "%i %i"
 
hmm :( can you help me pls im a noob

wrecked_ 07-18-2010 06:46

Re: split "%i %i"
 
Quote:

Originally Posted by mottzi (Post 1243183)
PHP Code:

new data nvault_get(n_vaultstring


:arrow:
PHP Code:

new data[32]
nvault_getn_vaultstringdata31 


mottzi 07-18-2010 06:49

Re: split "%i %i"
 
thank you :)

wrecked_ 07-18-2010 07:04

Re: split "%i %i"
 
Quote:

Originally Posted by mottzi (Post 1243198)
thank you :)

No problem.


All times are GMT -4. The time now is 07:15.

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