CLEO Help getting the first X characters of a string

CLEO related
Status
Not open for further replies.

Hackz0r

Active member
Joined
Oct 31, 2016
Messages
25
Reaction score
0
for example: 

Code:
alloc 0@ 64
format 0@ "UGBASE" //this could be any unknown string

//need to get only the first three characters of the string to end up with UGB

free 0@

I know you can do 0@ += 3 to get "ASE"
but is there a similar way of getting the first 3 characters of any string?
 
Joined
Dec 31, 2015
Messages
712
Reaction score
27
I know the way to do it with Sampfunc, ofc you can do it w\o but then you should make your function i guess
0C24: strncpy destination 1@ source 2@ size 3@

Example :
Code:
alloc 0@ 64
format 0@ "not gay but 20$ is 20$"
0C24: strncpy 0@ 0@ 7
//0@ is contains "not gay" now
//anything here
free 0@
 
Status
Not open for further replies.
Top