Hello,
what I'm trying to achieve is when i write command with some added text it changes what certain key does.
For exampe:
By default in script if I press key 2 (KEYCODE - 50) it sends command to samp: "/ant ID_OR_NICK"
when I write command "/setant 12" it should change that if I press key 2 (KEYCODE - 50) it would send command to samp: "/ant 12", if i write "/setant Oose", it would send after keypress "/ant Oose"
Now what I have is this code:
Problem is that nor key_pressed 50 statment works, nor :setant works (if I write /setant something, it starts to lag and samp screen starts flickering)
Could someone please explain what should I change?
what I'm trying to achieve is when i write command with some added text it changes what certain key does.
For exampe:
By default in script if I press key 2 (KEYCODE - 50) it sends command to samp: "/ant ID_OR_NICK"
when I write command "/setant 12" it should change that if I press key 2 (KEYCODE - 50) it would send command to samp: "/ant 12", if i write "/setant Oose", it would send after keypress "/ant Oose"
Now what I have is this code:
Code:
{$CLEO .cs}
0000: NOP
REPEAT
Wait 0
Until 0AFA: is_samp_structures_available
0B34: "setant" @setant
1@v = "ID_OR_NICK"
While True
Wait 0
0AC8: 0@ = allocate_memory_size 260
0AB1: @ant 1 id 99 to 0@
if
0AB0: key_pressed 50
then
0AF9: samp say_msg "/ant %s" 1@v
END
0AC9: free_allocated_memory 0@
END
:setant
SAMP.IsCommandTyped(0@)
0AD4: $PLAYER_CHAR = scan_string 0@ format "%s" 1@v
CmdRet
:ant
0AF7: samp 1@ = get_base
1@ += 0x21A0E4
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252
005A: 1@ += 0@
1@ += 28
0AB2: 1 1@
Problem is that nor key_pressed 50 statment works, nor :setant works (if I write /setant something, it starts to lag and samp screen starts flickering)
Could someone please explain what should I change?