CLEO Help Activation change

CLEO related
Status
Not open for further replies.

TraCerX

Active member
Joined
Oct 17, 2014
Messages
114
Reaction score
0
It would be very helpful if somebody change the activation of code below. I don't want to activate it with command but only by typing for example REND in keyboard.
Code:
{$CLEO}
{$I SF}
//$PLAYER_ACTOR
0662: "MGMOLDOVA"
0662: "acheats.ru"


0B34: "rend" @cmd
0B34: "topic" @cmd1
0B34: "toobj" @cmd2
0B34: "toveh" @cmd3
0B34: "sendpic" @sendpic
0B34: "spawncar" @spawncar
0C7F: samp set_client_command "rend" description "îòêðûòü ìåíþ."
0C7F: samp set_client_command "rend" description "[dis] {009900} - óñòàíîâèòü äèñòàíöèþ."
0C7F: samp set_client_command "topic" description "[dis] {009900} - óñòàíîâèòü äèñòàíöèþ."
0C7F: samp set_client_command "toobj" description "[id]{009900} - òåëåïîðòàöèÿ ê îáúåêòó."
0C7F: samp set_client_command "toveh" description "[id]{009900} - òåëåïîðòàöèÿ ê òðàíñïîðòó."
0C7F: samp set_client_command "sendpic" description "[id]{009900} - îòïðàâèòü ðïê î âçÿòèè ïèêàïà."
0C7F: samp set_client_command "spawncar" description "[id]{009900} - ðåñïàâíèòü óêàçàíûé òðàíñïîðò."



13@ = Render.CreateFont("Verdana", 8, 12)
31@ = 70.0
const
color_sendRPC = 0xe3dc0b
end

const
REND_STATE = 30@
PICKUPS = 0
OBJECTS = 1
VEHICLES = 2
OFF = 3
CMDS = 4
end


while true
wait 0
//dialog
if 0B3C:  samp is_dialog_responded id 223 button 2@ list_item 3@ input_text 0

Then
if 2@ == 1    //okb
  then


  //ïèêàïû
  if 3@ == PICKUPS
  THEN
  if 08B7:   test REND_STATE bit PICKUPS
   then 29@ = 1
   else 29@ = 0
   end    
   0B12: 29@ 29@ 1    
   if 29@ == 1
   then 08BD: set REND_STATE bit PICKUPS
   0AF8: "[Pool Render] Pickups render {FFFFFF}enabled. {007000}/%c by mgmoldova (acheats.ru) " color_sendRPC  0x2F
   else 08C3: clear REND_STATE bit PICKUPS
   0AF8: "[Pool Render] Pickups render {FFFFFF}disabled. {007000}/%c by mgmoldova (acheats.ru)" color_sendRPC 0x2F
   end     
  END
  //îáúåêòû 
  if 3@ == OBJECTS
  THEN
   if 08B7:   test REND_STATE bit OBJECTS
   then 29@ = 1
   else 29@ = 0
   end
   
   0B12:  29@ 29@ 1
   
   if 29@ == 1
   then 08BD: set REND_STATE bit OBJECTS
   0AF8: "[Pool Render] Objects render {FFFFFF}enabled. {007000}/%c by mgmoldova (acheats.ru)" color_sendRPC 0x2F 
   else 08C3: clear REND_STATE bit OBJECTS
   0AF8: "[Pool Render] Objects render {FFFFFF}disabled. {007000}/%c by mgmoldova (acheats.ru)" color_sendRPC  0x2F
   end     
  END 
 //ìàøèíû
  if 3@ == VEHICLES
  THEN
   if 08B7:   test REND_STATE bit VEHICLES
   then 29@ = 1
   else 29@ = 0
   end
   
   0B12:  29@ 29@ 1
   
   if 29@ == 1
   then 08BD: set REND_STATE bit VEHICLES
   0AF8: "[Pool Render] Vehicles render {FFFFFF}enabled. {007000}/%c by mgmoldova (acheats.ru)" color_sendRPC  0x2F
   else 08C3: clear REND_STATE bit VEHICLES
   0AF8: "[Pool Render] Vehicles render {FFFFFF}disabled. {007000}/%c by mgmoldova (acheats.ru)" color_sendRPC 0x2F
   end     
  END 

     //Âûðóáèòü
  if 3@ == OFF
  THEN  0AF8:  "[Pool Render] All renders are turned off. {007000}/%c by mgmoldova (acheats.ru)" color_sendRPC  0x2F 
   08C3: clear REND_STATE bit PICKUPS
   08C3: clear REND_STATE bit OBJECTS
   08C3: clear REND_STATE bit VEHICLES 
  END 
  
     //êîìàíäû
  if 3@ == CMDS
  THEN  
  0AC6: 3@ = label @label1 offset
  Samp.ShowDialog(789,"Êîìàíäû Pool Render",3@,"OK","",0)
  END 
          
end //okbu
End  //dialog
  
//render

 if 08B7:   test REND_STATE bit PICKUPS
 then gosub @PickRend
 end
 if 08B7:   test REND_STATE bit OBJECTS
 then gosub @ObjRend
 end
 if  08B7:   test REND_STATE bit VEHICLES
 then gosub @VehRend
 end

   
END

//
/////////////êÎÌÀÍÄÛ
//
:cmd
0B35: 0@
if 0AD4: 4@ = scan_string 0@ format "%f" 31@ 
then  0AF8: "[Pool Render] Render distance set to {FFFFFF}%.2f m." color_sendRPC 31@
else
0AC6: 3@ = label @label offset
0B3B: samp show_dialog id 223 caption "{009000}Pool Render" text 3@ button_1 "OK" button_2 "Esc" style 2
end
Samp.CmdRet()
:label
hex
"{FFFFFF}1) {009900}Ïîêàçàòü {FFFFFF}ïèêàïû." A
"{FFFFFF}2) {009900}Ïîêàçàòü {FFFFFF}îáúåêòû." A
"{FFFFFF}3) {009900}Ïîêàçàòü {FFFFFF}òðàíñïîðò." A 
"{FFFFFF}4) {CC0000}Îòêëþ÷èòü âñå" A 
"{FFFFFF}5) {FFFFFF}Êîìàíäû" A 
00                         
end
:label1
hex
"{009900}Äîñòóïíûå êîìàíäû:" A
"{FFFFFF}/rend {009900} - îòêðûòü ìåíþ." A
"{FFFFFF}/rend [dis] {009900} - óñòàíîâèòü äèñòàíöèþ." A
"{FFFFFF}/topic [id]{009900} - òåëåïîðòàöèÿ ê ïèêàïó." A 
"{FFFFFF}/toobj [id]{009900} - òåëåïîðòàöèÿ ê îáúåêòó." A 
"{FFFFFF}/toveh [id]{009900} - òåëåïîðòàöèÿ ê òðàíñïîðòó." A
"{FFFFFF}/sendpic [id]{009900} - îòïðàâèòü ðïê î âçÿòèè ïèêàïà." A
"{FFFFFF}/spawncar [id]{009900} - îòïðàâèòü ðïê î ðåñïàâíå òðàíñïîðòà." A
" " A
"Àâòîð: mgmoldova" A
00                         
end
:cmd1
0B35: 0@
0C1A: 0@ = atoi 0@
0B51: samp 1@ = pickup_handle_by_id 0@
if 09D1:   pickup 1@ created
then
065B: store_pickup 1@ position_to 2@ 3@ 4@ 
if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere  2@ 3@ 4@  radius 31@ 31@ 31@
then
Actor.PutAt($PLAYER_ACTOR 2@ 3@ 4@)
else 0AF8: "[Pool Render] {FFFFFF}Ïèêàï %d íàõîäèòñÿ äàëüøå, ÷åì %.2f. {FFFFFF}(Èñïîëüçóé: /rend [float])" color_sendRPC 0@ 31@
end
else 0AF8: "[Pool Render] {FFFFFF}Ïèêàï %d íå ñóùóåòâóåò." color_sendRPC 0@
end
Samp.CmdRet

:cmd2
0B35: 0@
0C1A: 0@ = atoi 0@
0B50: samp 1@ = object_handle_by_id 0@

if 03CA:   object 1@ exists
then
01BB: store_object 1@ position_to 2@ 3@ 4@ 
if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere  2@ 3@ 4@  radius 31@ 31@ 31@
then
Actor.PutAt($PLAYER_ACTOR 2@ 3@ 4@)
else 0AF8: "[Pool Render] {FFFFFF}Îáúåêò %d íàõîäèòñÿ äàëüøå, ÷åì %.2f. {FFFFFF}(Èñïîëüçóé: /rend [float])" color_sendRPC 0@ 31@
end
else 0AF8: "[Pool Render] {FFFFFF}Îáúåêò %d íå ñóùóåòâóåò." color_sendRPC 0@
end
Samp.CmdRet

:cmd3
0B35: 0@
0C1A: 0@ = atoi 0@
1@ = Samp.GetVehicleHandleBySAMPVehicleID(0@)
if 056E:  1@
then
Car.StorePos(1@ 2@ 3@ 4@)
if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere  2@ 3@ 4@  radius 31@ 31@ 31@
then
Actor.PutAt($PLAYER_ACTOR 2@ 3@ 4@)
else 0AF8: "[Pool Render] {FFFFFF}Òðàíñïîðò %d íàõîäèòñÿ äàëüøå, ÷åì %.2f. {FFFFFF}(Èñïîëüçóé: /rend [float])" color_sendRPC 0@ 31@
end
else 0AF8: "[Pool Render] {FFFFFF}Òðàíñïîðò %d íå ñóùóåòâóåò." color_sendRPC 0@
end
Samp.CmdRet

:sendpic
0B35: 0@
0C1A: 0@ = atoi 0@ 
0BD1: samp send_picked_up_pickup 0@
0AF8: "[Pool Render] {FFFFFF}Send pickup  {007000}%d{FFFFFF}." color_sendRPC 0@ 
Samp.CmdRet()

:spawncar
0B35: 0@
0C1A: 0@ = atoi 0@ 
0BD4: samp send_vehicle_destroyed 0@
0AF8: "[Pool Render] {FFFFFF}Vehicle respawn {007000}%d{FFFFFF}." color_sendRPC 0@ 
Samp.CmdRet()

:PickRend
for 0@ = 0 to MAX_PICKUPS 
03F0: enable_text_draw 1 
1@ = SAMP.PickupHandleByID(0@)
065B: store_pickup 1@ position_to 2@ 3@ 4@ 
 if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere  2@ 3@ 4@  radius 31@ 31@ 31@
 then
     if call @convert 3 2@ 3@ 4@ ret 5@ 6@   
     then
     call @GetPickupModelbySampID 1 0@ ret 10@
     alloc 11@ 260 
     //0C11:  11@ 0 260
     format 11@ "{107010}Pickup: {FFFFFF}%d {107010}Model: {FFFFFF}%d" 0@ 10@
     0B6F: render font 13@ draw_text 11@ pos  5@ 6@ color 0xe3dc0bff
     free 11@ 
     end
 end  
end
return

:VehRend
for 0@ = 0 to MAX_VEHICLES 
03F0: enable_text_draw 1 
if 1@ = SAMP.GetVehicleHandleBySAMPVehicleID(0@)
then
00AA: store_car 1@ position_to 2@ 3@ 4@ 
 if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere  2@ 3@ 4@  radius 31@ 31@ 31@
 then
     if call @convert 3 2@ 3@ 4@ ret 5@ 6@   
     then
     0441: 10@ = car 1@ model
     alloc 11@ 260 
     //0C11:  11@ 0 260
     format 11@ "{7e770b}Vehicle: {FFFFFF}%d {7e770b}Model: {FFFFFF}%d" 0@ 10@
     0B6F: render font 13@ draw_text 11@ pos  5@ 6@ color 0xe3dc0bff
     free 11@ 
     end
 end  
end
end
return


:ObjRend
for 0@ = 0 to MAX_OBJECTS 
03F0: enable_text_draw 1 
1@ = SAMP.ObjectHandleByID(0@)
if 03CA:   object 1@ exists
then
01BB: store_object 1@ position_to 2@ 3@ 4@ 
 if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere  2@ 3@ 4@  radius 31@ 31@ 31@
 then
     if call @convert 3 2@ 3@ 4@ ret 5@ 6@   
     then
     //call @GetPickupModelbySampID 1 0@ ret 10@
     0984: 10@ = object 1@ model

     alloc 11@ 260 
     0C11:  11@ 0 260
     format 11@ "{e3dc0b}Object: {FFFFFF}%d {e3dc0b}Model: {FFFFFF}%d" 0@ 10@
     0B6F: render font 13@ draw_text 11@ pos  5@ 6@ color 0xe3dc0bff
     free 11@ 
     end
 end  
end
end
return

// /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
// =====CALL_SCM_FUNCS=======  //
// /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/      
:convert
0B55: convert_3D_coords 0@ 1@ 2@ to_screen 5@ 6@
if and
not 5@ > 640.0 
not 6@ > 480.0 
5@ >= 0.0 
6@ >= 0.0 
00C2:   sphere_onscreen 0@ 1@ 2@ radius 0.0 
then 0485:  return_true
else 059A:  return_false
end
ret 2 5@ 6@

:GetPickupModelbySampID
0BB9: samp 10@ = get_pickup_pool_ptr
0@ *= 20
0@ += 61444
005A: 10@ += 0@ 
0A8D: 10@ = read_memory 10@ size 4 virtual_protect 0
ret 1 10@
Your help will make me very happy.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
937
Location
Lithuania
@TraCerX
PHP:
 if 0ADC:   test_cheat "rend" //3@ == CMDS
 THEN  
 0AC6: 3@ = label @label1 offset
 Samp.ShowDialog(789,"?????ä? Pool Render",3@,"OK","",0)
 END
 

TraCerX

Active member
Joined
Oct 17, 2014
Messages
114
Reaction score
0
Parazitas said:
@TraCerX
PHP:
 if 0ADC:   test_cheat "rend" //3@ == CMDS
 THEN  
 0AC6: 3@ = label @label1 offset
 Samp.ShowDialog(789,"?????ä? Pool Render",3@,"OK","",0)
 END

Thanks but where do i put this?
 

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
52
Location
LongForgotten <-> 0x32789
TraCerX said:
Parazitas said:
@TraCerX
PHP:
 if 0ADC:   test_cheat "rend" //3@ == CMDS
 THEN  
 0AC6: 3@ = label @label1 offset
 Samp.ShowDialog(789,"?????ä? Pool Render",3@,"OK","",0)
 END

Thanks but where do i put this?

the loop, main loop or under while true function.
and remove command by deleting 
Code:
0B34: "rend" @cmd
and
Code:
:cmd
0B35: 0@
if 0AD4: 4@ = scan_string 0@ format "%f" 31@
then  0AF8: "[Pool Render] Render distance set to {FFFFFF}%.2f m." color_sendRPC 31@
else
0AC6: 3@ = label @label offset
0B3B: samp show_dialog id 223 caption "{009000}Pool Render" text 3@ button_1 "OK" button_2 "Esc" style 2
end
Samp.CmdRet()
 
Status
Not open for further replies.
Top