CLEO Help [Sampfuncs] Null params

CLEO related
Status
Not open for further replies.

renko

Active member
Joined
Jul 8, 2014
Messages
58
Reaction score
0
If i have a sampfuncs command with a param but the user don't put it.
Ex: Good: /test 25 -- Bad: /test
How can i check if that 25 is there because it crash my game.
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
0B34: samp register_client_command "test" to_label [member=4866]test[/member]

:loop
wait 0
goto @loop

:test
wait 0
SAMP.IsCommandTyped(0@)
if
0AD4: 1@ = scan_string 0@ format "%d" 2@
jf @CMD_RET
BLA BLA BLA . . .

:CMD_RET
wait 0
0AF8: samp add_message_to_chat "USAGE: /test <ID>" color 0xFFFFFF
SAMP.CmdRet
goto @loop
 

renko

Active member
Joined
Jul 8, 2014
Messages
58
Reaction score
0
TH3RM4L link said:
0B34: samp register_client_command "test" to_label [member=4866]test[/member]

:loop
wait 0
goto @loop

:test
wait 0
SAMP.IsCommandTyped(0@)
if
0AD4: 1@ = scan_string 0@ format "%d" 2@
jf @CMD_RET
BLA BLA BLA . . .

:CMD_RET
wait 0
0AF8: samp add_message_to_chat "USAGE: /test <ID>" color 0xFFFFFF
SAMP.CmdRet
goto @loop
Ok, i have this
Code:
:accept
wait 0
SAMP.IsCommandTyped(3@)
if
0AD4: 4@ = scan_string 3@ format "%d" 7@
jf @c_error
//It's ok
    if or
    7@ == 0
    7@ == 1
    then
    0006: 2@ = 7@
    0AF8: "Accept gun mode ->[%d]<-" 0xCF0300 2@
    else
    0AF8: "USAGE: /acceptmod [0/1]" color 0xCF0300
    end

samp.CmdRet()
goto @OFF

:c_error
wait 0
0AF8: "USAGE: /acceptmod [0/1]" color 0xCF0300
samp.CmdRet()
goto @OFF
No matter what i type (/acceptmod 1 or /acceptmod 0) my 2@ variable is always 0 :|
Why  :imoverit:
 

renko

Active member
Joined
Jul 8, 2014
Messages
58
Reaction score
0
pepeelpubero link said:
Try this:

Press F10 (options) on Sanny Builder, formats tab then on Case converting choose "As is".
....It isn't this..i have already done this from the begining

SOLVED. I made it
 
Status
Not open for further replies.
Top