CLEO Help Combined variable (Helpme lol)

CLEO related

Exploder

Member
Joined
Apr 26, 2020
Messages
7
Reaction score
0
Location
China
I have two variable now, How can I combine these two variables into one variable?
1. 0B36: samp 2@ = get_player_nickname 1@
2. 0C3A: 3@ = string "User:" pointer
if 2@ = "Oops"
how to make them to 4@ that is "User:Oops"
help me pls!
 
Solution
PHP:
... // something ...
0B36: samp 2@ = get_player_nickname 1@
If 0C21: stricmp string1 2@ string2 "Oops" // if the nickname is the "oops"... Case Insensitive
Then
        // Temporarily borrow a buffer that will store the string.
    0AC8: 4@ = allocate_memory_size 30 // maximum of 30-1=29 characters
    0AD3: 4@ = format "User:%s" 2@ // left to right text formatting // write it to 4@
        // Do something you want to this combined string
    0AD1:   show_formatted_text_highpriority "combined text:~n~%s" time 2000 4@
        //
    0AC9: free_allocated_memory 4@ // we have any more use for it, so we free this temporary memory region 4@
End
... // Something ...

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
PHP:
... // something ...
0B36: samp 2@ = get_player_nickname 1@
If 0C21: stricmp string1 2@ string2 "Oops" // if the nickname is the "oops"... Case Insensitive
Then
        // Temporarily borrow a buffer that will store the string.
    0AC8: 4@ = allocate_memory_size 30 // maximum of 30-1=29 characters
    0AD3: 4@ = format "User:%s" 2@ // left to right text formatting // write it to 4@
        // Do something you want to this combined string
    0AD1:   show_formatted_text_highpriority "combined text:~n~%s" time 2000 4@
        //
    0AC9: free_allocated_memory 4@ // we have any more use for it, so we free this temporary memory region 4@
End
... // Something ...
 
Solution

Exploder

Member
Joined
Apr 26, 2020
Messages
7
Reaction score
0
Location
China
PHP:
... // something ...
0B36: samp 2@ = get_player_nickname 1@
If 0C21: stricmp string1 2@ string2 "Oops" // if the nickname is the "oops"... Case Insensitive
Then
        // Temporarily borrow a buffer that will store the string.
    0AC8: 4@ = allocate_memory_size 30 // maximum of 30-1=29 characters
    0AD3: 4@ = format "User:%s" 2@ // left to right text formatting // write it to 4@
        // Do something you want to this combined string
    0AD1:   show_formatted_text_highpriority "combined text:~n~%s" time 2000 4@
        //
    0AC9: free_allocated_memory 4@ // we have any more use for it, so we free this temporary memory region 4@
End
... // Something ...
thx!
 
Top