CihatveSavaş
Member
I want Cleo to press the Y key at coordinates 1766.3939 584.2593 and 1767.6270 588.9038
This code does not work because when you press the y key on the server, it opens in the inventory and there are no coordinates in these codes.[SNIPPET] Set Virtual or Game Key
100% - Working without SAMPFUNCS Example.: {$CLEO .cs} 0000: NOP WAIT 10000 WHILE TRUE WAIT 0 IF 0AB0: key_pressed 90 {Z} THEN 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255 WAIT 30 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0 END END :Set_Virtual_Key { 255 = true...ugbase.eu
[SNIPPET] Set Virtual or Game Key
100% - Working without SAMPFUNCS Example.: {$CLEO .cs} 0000: NOP WAIT 10000 WHILE TRUE WAIT 0 IF 0AB0: key_pressed 90 {Z} THEN 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255 WAIT 30 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0 END END :Set_Virtual_Key { 255 = true...ugbase.eu
{$CLEO .cs}
0000:
:1
wait 0
if or
00EC: actor $PLAYER_ACTOR sphere 0 near_point 1766.3939 584.2593 radius 5.0 5.0
00EC: actor $PLAYER_ACTOR sphere 0 near_point 1767.6270 588.9038 radius 5.0 5.0
jf @1
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59 state 255
WAIT 30
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59 state 0
wait 1000
jump @1
:Set_Virtual_Key
{
255 = true
0 = false
0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255
}
2@ = 0xB72CC8
0@ *= 2
005A: 2@ += 0@ // (int)
0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0
0AB2: ret 0
Test it
JavaScript:{$CLEO .cs} 0000: :1 wait 0 if or 00EC: actor $PLAYER_ACTOR sphere 0 near_point 1766.3939 584.2593 radius 5.0 5.0 00EC: actor $PLAYER_ACTOR sphere 0 near_point 1767.6270 588.9038 radius 5.0 5.0 jf @1 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59 state 255 WAIT 30 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x59 state 0 wait 1000 jump @1 :Set_Virtual_Key { 255 = true 0 = false 0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255 } 2@ = 0xB72CC8 0@ *= 2 005A: 2@ += 0@ // (int) 0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0 0AB2: ret 0