CLEO Help The SAMP.Blabla function

CLEO related
Status
Not open for further replies.

cl0udddie

Member
Joined
Mar 18, 2017
Messages
11
Reaction score
0
Hello, its me again.
I'm kinda confused with the SAMP. function like, SAMP.CmdRet, SAMP.Dialog etc. My question is, where can I get the full list of this function like browing the opcode. Also can you give me an example usage of this opcode:

[shcode=cpp]
0B3B: samp show_dialog id 1@ caption 2@ text 3@ button_1 4@ button_2 5@ style 6@
[/shcode] 
I tried to do this: 
[shcode=cpp]
0B3B: samp show_dialog id "dialog help!" "1. ALT + 1 for storing position, ALT + 2 for tp to your save position.\n2. /m4 for spawning m4." "I" "Understand" DIALOG_STYLE_MSGBOX
[/shcode] 
When executing the command for that dialog, my game just instantly crash. Any help will be appreciated, thank you :)
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Use code tags to separate code from your text, cause it's hard to read and understand.
My guess, you forgot to use an id here,

[shcode=cpp]
0B3B: samp show_dialog id 333 "dialog help!"
[/shcode]

You can find all the classes functions by going to your SB install folder\data\sa, and open the classes.db with any text editor.
 

cl0udddie

Member
Joined
Mar 18, 2017
Messages
11
Reaction score
0
springfield said:
Use code tags to separate code from your text, cause it's hard to read and understand.
My guess, you forgot to use an id here,

[shcode=cpp]
0B3B: samp show_dialog id 333 "dialog help!"
[/shcode]

You can find all the classes functions by going to your SB install folder\data\sa, and open the classes.db with any text editor.

Hello springfield, thank you for reading and replying my thread.
I tried to add the dialog id but SB keep giving me the same error on that line which is:
Code:
Not enough actual parameters. Expected 6 params.

The code that giving error:
I changed it from:
[shcode=cpp]
0B3B: samp show_dialog id "dialog help!" "1\n2\n3\n4" "OK" "CLOSE" DIALOG_STYLE_MSGBOX
[/shcode]
to: 
[shcode=cpp]
0B3B: samp show_dialog id 4 caption "dialog help!" text "1\n2\n3\n4" button_1 "OK" button_2 "CLOSE" style DIALOG_STYLE_MSGBOX
[/shcode]

The full label contain that opcode:
[shcode=cpp]
:HELP
wait 0
0B3B: samp show_dialog id 4 caption "dialog help!" text "1\n2\n3\n4" button_1 "OK" button_2 "CLOSE" style DIALOG_STYLE_MSGBOX
SAMP.CmdRet
[/shcode]

I tried to add the dialog id too but still error. In my opinion that code already has 6 parameters or am I wrong? because SB telling me that I'm wrong. Anyway thank you for helping me and telling me how to browse the classes function.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
271
Did you use "{$INCLUDE SF}"? To include sampfuncs defines, else DIALOG_STYLE_MSGBOX is not defined to a number, and SB will ignore it resulting in 5 actual parameters used, instead of 6.
 

cl0udddie

Member
Joined
Mar 18, 2017
Messages
11
Reaction score
0
springfield said:
Did you use "{$INCLUDE SF}"? To include sampfuncs defines, else DIALOG_STYLE_MSGBOX is not defined to a number, and SB will ignore it resulting in 5 actual parameters used, instead of 6.

I didn't use that, sorry that was my fault and now its working after I added it into my CLEO Script. Again, thank you for helping me springfield. Have a nice day!

P.S: Mod you can lock this thread now.
 
Status
Not open for further replies.
Top