SMS

Status
Not open for further replies.

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
677
Likes
2
Points
18
Location
Lithuania
Website
ugbase.eu
#1
Why samp freeze?

PHP:
{$CLEO .cs}

0000: NOP

REPEAT
  WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 

0B34: "sms" @Command

alloc [email protected] 200

WHILE TRUE
  WAIT 0
END

:Command
0B35: [email protected] = get_last_command_params
if
0AD4: [email protected] = scan_string [email protected] format "%d %s" [email protected] [email protected] //IF and SET
then
[email protected] = SAMP.GetActorHandleByPlayerID([email protected])
0B36: samp [email protected] = get_player_nickname [email protected]
0AF8: "You say: /sms %s %s"  -1 [email protected] [email protected]
end

0B43:
@Monday
 
OP
OP
Parazitas

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
677
Likes
2
Points
18
Location
Lithuania
Website
ugbase.eu
#4
supahdupahnubah said:
Perhaps [email protected] is not allocated also
Still same samp freeze...


I trying get player name when i write player id and send msg...

PHP:
{$CLEO .cs}

0000: NOP

REPEAT
  WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 

0B34: "sms" @Command

alloc [email protected] 200
alloc [email protected] 200

WHILE TRUE
  WAIT 0
END

:Command
0B35: [email protected] = get_last_command_params
if 
0AD4: [email protected] = scan_string [email protected] format "%d %s" [email protected] [email protected] //IF and SET  
then
[email protected] = SAMP.GetActorHandleByPlayerID([email protected])
0B36: samp [email protected] = get_player_nickname [email protected]
0AF8: "You say: /sms %s %s"  -1 [email protected] [email protected]
end

0B43: 

 

monday

Well-Known Member
Joined
Jun 23, 2014
Messages
918
Likes
3
Points
18
#5
just add debug lines, recreate freeze, check chatlog and you'll know at which point the code caused problem

Edit: If it's 0AF8 I would try to use "0C15: strcat" opcode instead
https://translate.google.co.uk/translate?hl=en&sl=ru&tl=en&u=https%3A%2F%2Fblast.hk%2Fwiki%2Fopcodes%3A0c15
 

noob213

Well-Known Member
Joined
Sep 15, 2017
Messages
72
Likes
0
Points
6
#7
the operation code 0AD4: you can not extract a chain from the chain

use the 16-byte variable [email protected]

Code:
REPEAT
 WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 

0B34: "sms" @Command

WHILE TRUE
 WAIT 0
END

:Command
0B35: [email protected] = get_last_command_params
if
0AD4: [email protected] = scan_string [email protected] format "%d %s" [email protected] [email protected] //IF and SET
then
0B36: samp [email protected] = get_player_nickname [email protected]
0AF8: "You say: /sms %s %s"  -1 [email protected] [email protected]
end
0B43: samp cmd_ret

or use the function scanf directly by legend2360

Code:
REPEAT
  WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 

0B34: "sms" @cmd

WHILE TRUE
  WAIT 0
END

:cmd
0B35: samp [email protected] = get_last_command_params
    alloc [email protected] 128
    0AA5: call 0x8220AD num_params 4 pop 4 params [email protected] [email protected] "%d %s" [email protected] [email protected]
    0B36: samp [email protected] = get_player_nickname [email protected]
    0AF8: "You say: /sms %s %s"  -1 [email protected] [email protected]  
    free [email protected]     
0B43: samp cmd_ret
https://blast.hk/threads/7486/
 
OP
OP
Parazitas

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
677
Likes
2
Points
18
Location
Lithuania
Website
ugbase.eu
#8
noob213 said:
the operation code 0AD4: you can not extract a chain from the chain

use the 16-byte variable [email protected]

Code:
REPEAT
 WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 

0B34: "sms" @Command

WHILE TRUE
 WAIT 0
END

:Command
0B35: [email protected] = get_last_command_params
if
0AD4: [email protected] = scan_string [email protected] format "%d %s" [email protected] [email protected] //IF and SET
then
0B36: samp [email protected] = get_player_nickname [email protected]
0AF8: "You say: /sms %s %s"  -1 [email protected] [email protected]
end
0B43: samp cmd_ret

or use the function scanf directly by legend2360

Code:
REPEAT
  WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 

0B34: "sms" @cmd

WHILE TRUE
  WAIT 0
END

:cmd
0B35: samp [email protected] = get_last_command_params
    alloc [email protected] 128
    0AA5: call 0x8220AD num_params 4 pop 4 params [email protected] [email protected] "%d %s" [email protected] [email protected]
    0B36: samp [email protected] = get_player_nickname [email protected]
    0AF8: "You say: /sms %s %s"  -1 [email protected] [email protected]  
    free [email protected]     
0B43: samp cmd_ret
https://blast.hk/threads/7486/
Create snippet with this or something like that , maybe somebody  else need this.

P.S.
work only ' function scanf directly by legend2360 '
Thanks all.

@noob213
@supahdupahnubah
@monday
 

supahdupahnubah

Well-Known Member
Joined
Dec 31, 2015
Messages
673
Likes
1
Points
18
#9
Parazitas said:
Create snippet with this or something like that , maybe somebody  else need this.

P.S.
work only ' function scanf directly by legend2360 '
Thanks all.

@noob213
@supahdupahnubah
@monday
The first works for me tho
Maybe it doesnt work for you quite right because you input more than 16 chars
 
OP
OP
Parazitas

Parazitas

Well-Known Member
Joined
Jan 2, 2017
Messages
677
Likes
2
Points
18
Location
Lithuania
Website
ugbase.eu
#10
supahdupahnubah said:
Parazitas said:
Create snippet with this or something like that , maybe somebody  else need this.

P.S.
work only ' function scanf directly by legend2360 '
Thanks all.

@noob213
@supahdupahnubah
@monday
The first works for me tho
Maybe it doesnt work for you quite right because you input more than 16 chars
 
You saying true, thanks for inform.
 
Status
Not open for further replies.
Top