CLEO Few mods

monday

Новичок
Автор темы
1
7
привет
I'd like to share with you a pack of cleo mods made by me. The pack includes:
supremeTroll

Video:

Commands:
/trollinfo - (displays all the commands)
/pos - (save position)
/dpos - (delete last saved position)
/r2 - (set rain over your last saved position - occupied vehicles only)
/r2 <driverID> - (throw a single raindrop)
/fw (set fireworks over your last saved position - occupied vehicles only)
/fw <driverID> - (throws a specific player upwards)
/ccars - (counts occupied vehicles in the area)
/hp <driverID> <carhp> - (set hp of a specific car around you)
/hpu <carID> <carhp> - (set hp of a specific unoccupied car around you)
/tp <driverID> to <playerID> - (teleport a driver to streamed in player)
/tp <driverID> to <placename> - [mc - Mount Chillad][tw - LS Tower][pd - Police Department]
/sm <driverID> <playerID> - (smashes the driver into another player)
/showid - (shows IDs of the streamed players)
/showcarid - (shows IDs and health of the streamed vehicles)
/s1 <Name_Surname> - (Player indicator) [from /s1 to /s9]
blue - in car
white - on foot
grey - streamed out
black - offline
/sswitch - (hides/shows the current searches)
/lag - (teleports all the unoccupied vehicles from the surrounding area to one places, syncs them, then teleports them a bit higher without syncing, everyone is lagging hard except you)[you might lag a bit though]
/col - (you can ram a tank with a faggio)
/fwh - (same as /fw but throws the car higher without changing its hp)
/bm <playerID> - (teleports 4 random unoccupied vehicles 100 meters over a specified player and explodes them, it's not perfect)
/reu - (respawns unoccupied vehicles by setting their health to 0)
/tpall to <playerID> - (teleport all the cars to streamed in player)
/tpall to <placename> - [pos - last saved position][mc - Mount Chillad][tw - LS Tower][pd - Police Department]
/hpall <HPvalue> - set hp of all occupied cars
/thr <driverID> - throws a player to the north
/small <driverID> - continuously smashes all the players and cars using specified driver (press 0 to stop)
/smallc <driverID> - continuously smashes all the occupied cars using specified driver (press 0 to stop)

Updates
12/10/14 - fixed crashes
30/10/14 - added /lag, /fwh and /col commands
29/12/14 - added /bm <playerID> command
29/12/14, 21:10 - added /reu command
16/01/15 - added /tpall, /hpall, /thr, /small, /smallc

Bugs
-on some servers you may get "server has closed connection" (I tested it only on IMRP and NEF stunt/dm server)
-/showcarid potentially may be malfunctioning (works well to me but someone reported the issue, you might use /dl insead to get the veh's ID)
-cars teleported by /bm <playerID> command may not fall down on servers where vehicle movement is disabled when there is no players around (for example on NEF server it worked properly while on "LS Cops and Robbers" the cars were stopped in the air)
-using other commands while being in no-collision mode (/col) causes warnings

Tested with
-Cleo 4.1
-Samp Functions 5.1
-MG Functions impossible 4.3
-SA-MP 0.3z R1

Additional info
-To delete the player you're currently searching (/s1 name) use /s1 without typing any name. There is no number of the search displayed so sometimes it might be problematic to remember which /s is the specific name.
-"/r2" command ejects you for a moment from your vehicle (it's not visible to you because of the camera move but it potentially might be visible to others)
-"/showcarid" is currently limited to 1000 IDs max; /showid is limited to 300 IDs max
-"/tp <driverID> to pd" probably works only on IMRP where Police Department has an underground garage
-Setting someone's car hp to 0 will probably destroy the car + respawn it quickly, if you'd like to just stop the car and destroy the engine then around 34hp is the right number
-the idea of /bm <playerID> where vehicles fall in order to explode has been niggered from "NGRP Sadler Bomber" by Howl

Source:
http://pastebin.com/kJ4rMMGu







Safemode
Little mod useful when someone is using trolls on your car. It protects from teleport and sets the hp to 100 repeatedly so you have time to troll him back. It's not effective against rapidfire/rpg.

Command:

/safe

Tested with
-Cleo 4.1
-Samp Functions 5.1
-MG Functions impossible 4.3
-SA-MP 0.3z R1
Each colour/search is limited to 15 objects. It may crash if there's like 30-40 objects found but special items on most of the servers tend to be rare so I doubt it's going to be an issue for you. Togging/resetting the searches may prevent potential crashes if they occur when you TP or enter interior.

me6gB7P.jpg


Tested with:
-Cleo 4.1
-Sampfuncs 5.1
-MG Functions impossible 4.3
-SA-MP 0.3z R1

Commands:
/ohelp
gq6XdZu.jpg



Updates
19/01/2015 - V1.1 added markers on the map using snippet "3d coords to 2d radar" by Opcodexe, the closest objects of each type are blinking red
23/01/2015 - V1.1+ added radar zoom-out compensation for more accurate markers position on the radar when the player is moving
01/02/2015 - V1.2 pickups and single player objects are now findable, /objectid command shows their model ID too

Bugs:
-If /objectid doesn't work or if you don't want to see objects located behind walls check pepeelpubero's fix at http://ugbase.eu/releases-6/supremetroll/msg62534/#msg62534
-Teleporting may cause warnings sometimes

showobjectid command:
/objectid - displays modelID of the objects around you

Source:
http://pastebin.com/3zg6Dm8A
Video:

Tested with:
-Cleo 4.1
-Sampfuncs 4.0
-MG functions 4.3
-SA-MP 0.3z R1

Installation:
1. Put all the 3 files from "CLEO" folder in your GtaSA/cleo folder
2. Put xmas.txd from "txd" folder in your GtaSA/models/txd folder
3. Optionally put "showobjectid.cs" in your GtaSa/cleo folder

Commands:
/xhelp
3hLHSu1.jpg


Download:(too big to use default attachments)
http://www.mediafire.com/download/5xubemcqlf5rel1/objectFinderChristmasEdition.rar

Additional info:
-To turn off the auto-music open the oSettings.ini and change "1" into "0"
-Download includes 13 songs in mp3 format, that's the reason why the size is so big
-You can replace the songs (cleo/music/oFinder_audio/) with any mp3 files you want (you must rename them to 1-13 + there can't be more than 13 songs)
-Arrows show direction to the closest object of each type

Bugs:
-/xm command cousing crash while being in car

Source:
http://pastebin.com/BapLq890

Original mod was made by Mr.Ze, this is a modified version of it. It looks like he's not here to attach it to his release and I think it's worth to share it separately as it gives some more possibilities.

Command:
/co <driverID> - while driving vehicle

Tested with:
-Cleo 4.1
-Samp Functions 5.0
-MG Functions impossible 4.3
-SA-MP 0.3z R1

Source:
Код:
{$CLEO .cs}

0B34: samp register_client_command "co" to_label @activation
0000: NOP
0@ = 0

:Control
wait 0
if 0@ == 1
then
036A: put_actor $PLAYER_ACTOR in_car 5@
0@ = 2
else
  if 0@ == 3
  then
  036A: put_actor $PLAYER_ACTOR in_car 4@
  0@ = 0
  end
end
jump @Control

:activation
wait 0
if 0@ == 2
then
0B2D: write samp_memory 0x12D60 value 1@ size 2
0B2D: write samp_memory 0x13FA0 value 2@ size 2
0B2D: write samp_memory 0x78560 value 3@ size 2
0@ = 3
0159: camera_on_ped $PLAYER_ACTOR mode 4 switchstyle 2
015A: restore_camera
02EB: restore_camera_with_jumpcut
0373: set_camera_directly_behind_player
0AF8: samp add_message_to_chat "{8650AC}[CarControl]: {FF0000}You are no longer in control!" color 0xFFFFFF
SAMP.CmdRet
end

if and
Player.Defined($PLAYER_ACTOR)
0449:  actor $PLAYER_ACTOR in_a_car
then
  0B35: samp 25@ = get_last_command_params
  if
  0AD4: 26@ = scan_string 25@ format "%d" 24@ //IF and SET
  then
  if
  0B23:  samp is_player_connected 24@
  then
  if
  0B20: samp 27@ = actor_handle_by_samp_player_id 24@
  then
  if
  0449:  actor 27@ in_a_car
  then
  5@ = Actor.CurrentCar(27@)   
  0B2E: 1@ = read_samp_memory 0x12D60 size 2
  0B2D: write samp_memory 0x12D60 value 0xC390 size 2
  0B2E: 2@ = read_samp_memory 0x13FA0 size 2
  0B2D: write samp_memory 0x13FA0 value 0xC390 size 2
  0B2E: 3@ = read_samp_memory 0x78560 size 2
  0B2D: write samp_memory 0x78560 value 0xC20400 size 2
  4@ = Actor.CurrentCar($PLAYER_ACTOR)
  0@ = 1
  0158: camera_on_car 5@ mode 18 switchstyle 2
  0AF8: samp add_message_to_chat "{8650AC}[CarControl]: {00CD00}You are in control now!" color 0xFFFFFF
  else 0AF8: samp add_message_to_chat "Specified player must be driving" color 0x9000   
  end
  else 0AF8: samp add_message_to_chat "Specified player is not streamed in" color 0x9000
  end   
  else 0AF8: samp add_message_to_chat "Specified player is offline" color 0x9000  
  end  
  else 0AF8: samp add_message_to_chat "Wrong format" color 0x9000   
  end   
else
0AF8: samp add_message_to_chat "You must be in a car" color 0x9000   
end   
SAMP.CmdRet

Original version by Mr.Ze:
http://ugbase.eu/releases-6/carcontrol-by-mr-ze-source
The mod shows who's shooting at who around player's streamed in area. It also checks the names to prevent spam with the same names, 15 seconds must pass till the same shooter/victim data is displayed. If the same player is shooting at the same victim within 15 seconds the displayed data is blinking.

Tested with:
-Cleo 4.1
-Sampfuncs 5.1
-MG Functions impossible 4.3
-SA-MP 0.3z R1

Installation:
1. Put shootingIndicator.cs inside your Cleo folder (the one from .rar file is not updated)
2. Put wpn.txd inside GTA/models/txd folder

Command:
/sitog - toggle

Updates:
13/01/2015 - improved the anti spam thing (it doesn't repeat within 15 seconds even if the same shooter and victim are on the 2nd/3rd/4th place, not only the 1st)
14/01/2015 - added ID to be displayed with the names + now the spammed names turn red for a moment to indicate who's repeatedly shooting the same person

twDeQc6.png


Bugs:
-This mod loads textures from .txd file. If you have any other cleo mod working which loads the textures(e.g. objectFinder Christmas edition) too you may get wrong image displayed instead of gun image.
-If the player who got shot will respawn/logout at the moment of being shot then some weird characters may be displayed instead of his name.

Additional info:
-As you can see on the image above the name of the shooter is not neatly alligned to the right. Currently it's adjusted by the number of letters which is not very accurate. If you know a way how to improve it please let me know in a comment

Source:
Код:
{$CLEO .cs}
0000: NOP
repeat
wait 50
until 0AFA: is_samp_structures_available
0AF8: samp add_message_to_chat "shootingIndicator is {00CC00}Enabled {F7F694}[Switch: /sitog]" color 0xF7F694
0B34: samp register_client_command "sitog" to_label @sitog
0AC8: 10@ = allocate_memory_size 260
0AC8: 9@ = allocate_memory_size 260
0AC8: 8@ = allocate_memory_size 260
0AC8: 7@ = allocate_memory_size 260
0AC8: 6@ = allocate_memory_size 260
0AC8: 5@ = allocate_memory_size 260
0AC8: 4@ = allocate_memory_size 260
0AC8: 3@ = allocate_memory_size 260
0390: load_txd_dictionary 'wpn'
038F: load_texture "upr" as 1 //ak
038F: load_texture "upl" as 2
038F: load_texture "up" as 3
038F: load_texture "triang" as 4
038F: load_texture "square" as 5  
038F: load_texture "right" as 6  
038F: load_texture "left" as 7  
038F: load_texture "downr" as 8
038F: load_texture "downl" as 9
038F: load_texture "down" as 10
038F: load_texture "cross" as 11
038F: load_texture "cring" as 12
038F: load_texture "circle" as 13  
038F: load_texture "chit" as 14  
13@ = 0
27@ = 1
33@ = 0

:First
wait 0
//variables for colors: 11@ 12@ 21@ 22@ 23@ 24@ 25@ 26@
//switcher 27@
//free 31@
// 28@ = spam indicator
if 27@ == 1
jf @First

if 0029:  13@ >= 1
then
0B5A: get_screen_resolution 14@ 15@ //int
14@ /= 10
14@ *= 8
15@ /= 10
15@ *= 7
  if 28@ == 1
  then
  28@ = 0
  0AB1: call_scm_func @DrawText 7 shooterName 3@ victimName 4@ posX 14@ posY 15@ weaponImage 17@ shooterColor 0xF21C00 victimColor 0xF21C00
  else
  0AB1: call_scm_func @DrawText 7 shooterName 3@ victimName 4@ posX 14@ posY 15@ weaponImage 17@ shooterColor 11@ victimColor 12@
  end
15@ += 27
end

if 0029:  13@ >= 2
then
  if 28@ == 2
  then
  28@ = 0
  0AB1: call_scm_func @DrawText 7 shooterName 5@ victimName 6@ posX 14@ posY 15@ weaponImage 18@ shooterColor 0xF21C00 victimColor 0xF21C00
  else
  0AB1: call_scm_func @DrawText 7 shooterName 5@ victimName 6@ posX 14@ posY 15@ weaponImage 18@ shooterColor 21@ victimColor 22@
  end
15@ += 27
end

if 0029:  13@ >= 3
then
  if 28@ == 3
  then
  28@ = 0
  0AB1: call_scm_func @DrawText 7 shooterName 7@ victimName 8@ posX 14@ posY 15@ weaponImage 19@ shooterColor 0xF21C00 victimColor 0xF21C00
  else
  0AB1: call_scm_func @DrawText 7 shooterName 7@ victimName 8@ posX 14@ posY 15@ weaponImage 19@ shooterColor 23@ victimColor 24@
  end
15@ += 27
end

if 0029:  13@ >= 4
then
  if 28@ == 4
  then
  28@ = 0
  0AB1: call_scm_func @DrawText 7 shooterName 9@ victimName 10@ posX 14@ posY 15@ weaponImage 20@ shooterColor 0xF21C00 victimColor 0xF21C00
  else
  0AB1: call_scm_func @DrawText 7 shooterName 9@ victimName 10@ posX 14@ posY 15@ weaponImage 20@ shooterColor 25@ victimColor 26@
  end
15@ += 27
end


for 30@ = 0 to 1001  
  if 30@ == 1001
  then
  0AB1: call_scm_func @PlayerActor_to_var 1 Actor handle $PLAYER_ACTOR _var 1@
  2@ = 0
  0AB1: call_scm_func @WasPlayerHit 1 Actor handle 1@ _returned 2@ _weaponName 16@ // 1@ = 1 means that hit, 1@ == 0 means not hit   
  if 2@ == 1   
  then   
  for 29@ = 0 to 1000   
  if
  SAMP.IsPlayerConnected(29@)
  then
  if
  0@ = SAMP.GetActorHandleByPlayerID(29@)
  then   
  if
  051A:  actor 1@ damaged_by_actor 0@
  then   
  jump @Second
  end   
  end   
  end
  end   
  end   
  else
  if
  SAMP.IsPlayerConnected(30@)
  then
  if
  1@ = SAMP.GetActorHandleByPlayerID(30@)
  then   
  2@ = 0
  0AB1: call_scm_func @WasPlayerHit 1 Actor handle 1@ _returned 2@ _weaponName 16@ // 1@ = 1 means that hit, 1@ == 0 means not hit   
  if 2@ == 1   
  then   
  for 29@ = 0 to 1001
  if 29@ == 1001
  then
  0AB1: call_scm_func @PlayerActor_to_var 1 Actor handle $PLAYER_ACTOR _var 0@
  if
  051A:  actor 1@ damaged_by_actor 0@
  then   
  jump @Second
  end   
  else   
  if
  SAMP.IsPlayerConnected(29@)
  then
  if
  0@ = SAMP.GetActorHandleByPlayerID(29@)
  then   
  if
  051A:  actor 1@ damaged_by_actor 0@
  then   
  jump @Second
  end   
  end   
  end
  end
  end   
  end   
  end   
  end
  end
end  
jump @First   
:Second // 0@ = shooter  1@ = victim
//variables for colors: 11@ 12@ 21@ 22@ 23@ 24@ 25@ 26@
//switcher 27@
//free 28@ 31@

wait 0  
054E: clear_actor 1@ damage
0467: clear_actor 0@ last_weapon_damage

if and
056D:  actor 0@ defined
056D:  actor 1@ defined
then
  if 001B:  15000 > 33@
  then
  0AB1: call_scm_func @GetActorName 1 Actor handle 0@ _returnedString 2@
  if
  0C14: strcmp string1 3@ string2 2@
  then
  0AB1: call_scm_func @GetActorName 1 Actor handle 1@ _returnedString 2@
  if
  0C14: strcmp string1 4@ string2 2@
  then
  28@ = 1
  jump @First
  end
  end
   
  0AB1: call_scm_func @GetActorName 1 Actor handle 0@ _returnedString 2@   
  if
  0C14: strcmp string1 5@ string2 2@
  then
  0AB1: call_scm_func @GetActorName 1 Actor handle 1@ _returnedString 2@
  if
  0C14: strcmp string1 6@ string2 2@
  then
  28@ = 2
  jump @First
  end
  end
   
  0AB1: call_scm_func @GetActorName 1 Actor handle 0@ _returnedString 2@   
  if
  0C14: strcmp string1 7@ string2 2@
  then
  0AB1: call_scm_func @GetActorName 1 Actor handle 1@ _returnedString 2@
  if
  0C14: strcmp string1 8@ string2 2@
  then
  28@ = 3
  jump @First
  end
  end
   
  0AB1: call_scm_func @GetActorName 1 Actor handle 0@ _returnedString 2@   
  if
  0C14: strcmp string1 9@ string2 2@
  then
  0AB1: call_scm_func @GetActorName 1 Actor handle 1@ _returnedString 2@
  if
  0C14: strcmp string1 10@ string2 2@
  then
  28@ = 4
  jump @First
  end
  end   
  end
   

  if 0029:  13@ >= 3
  then
  0085: 25@ = 23@
  0085: 26@ = 24@
  0085: 20@ = 19@
  0C13: strcpy destination 9@ source 7@
  0C13: strcpy destination 10@ source 8@
  end
   
  if 0029:  13@ >= 2
  then
  0085: 23@ = 21@
  0085: 24@ = 22@
  0085: 19@ = 18@
  0C13: strcpy destination 7@ source 5@
  0C13: strcpy destination 8@ source 6@
  end
   
  if 0029:  13@ >= 1
  then
  0085: 21@ = 11@
  0085: 22@ = 12@
  0085: 18@ = 17@
  0C13: strcpy destination 5@ source 3@
  0C13: strcpy destination 6@ source 4@
  end
   
  0085: 17@ = 16@   
   
  0AB1: call_scm_func @GetActorNameAndColor 1 Actor handle 0@ _returnedString 3@ _returnedColor 11@
  0AB1: call_scm_func @GetActorNameAndColor 1 Actor handle 1@ _returnedString 4@ _returnedColor 12@

  13@ += 1   
  33@ = 0
end
jump @First
   
   
:sitog
0B12: 27@ = 27@ XOR 1
if 27@ == 1
then
0AD1: show_formatted_text_highpriority "shootingIndicator is ~G~enabled" time 800
else
0AD1: show_formatted_text_highpriority "shootingIndicator is ~R~disabled" time 800
end
samp.CmdRet
   
     
   
   
// FUNCTIONS
//
//
//
//
//   
//
//
//
//
//   

//0AB1: call_scm_func @GetActorNameAndColor 1 Actor handle 0@ _returnedString 3@ _returnedColor 11@
:GetActorNameAndColor  
0AC8: 4@ = allocate_memory_size 260
0AC8: 3@ = allocate_memory_size 260
0B2B: samp 1@ = get_player_id_by_actor_handle 0@   
0B36: samp 2@ = get_player_nickname 1@
0C13: strcpy destination 3@ source 2@ // to prevent bug
0AD3: 4@ = format "(%d)" 1@
0C15: strcat destination 3@ source 4@
0B37: samp 5@ = get_player_color 1@
0AC9: free_allocated_memory 4@
0AB2: ret 2 3@ 5@  

//0AB1: call_scm_func @GetActorName 1 Actor handle 1@ _returnedString 2@
:GetActorName  
0AC8: 4@ = allocate_memory_size 260
0AC8: 3@ = allocate_memory_size 260
0B2B: samp 1@ = get_player_id_by_actor_handle 0@   
0B36: samp 2@ = get_player_nickname 1@
0C13: strcpy destination 3@ source 2@ // to prevent bug
0AD3: 4@ = format "(%d)" 1@
0C15: strcat destination 3@ source 4@
0AC9: free_allocated_memory 4@
0AB2: ret 1 3@

//0AB1: call_scm_func @DrawText 7 shooterName 0@ victimName 1@ posX 2@ posY 3@ weaponImage 4@ shooterColor 5@ victimColor 6@
:DrawText
03F0: enable_text_draw 1
0C17: 31@ = strlen 0@
31@ *= 10
0062: 2@ -= 31@  // (int)
0D94: draw_text 0@ pos_xy 2@ 3@ align_xy 0.0 0.0 color 5@ shadow 1
2@ += 76
005A: 2@ += 31@  // (int)
0D94: draw_text 1@ pos_xy 2@ 3@ align_xy 0.0 0.0 color 6@ shadow 1
2@ -= 38
3@ += 9
0B5F: convert_window_screen_coords 2@ 3@ to_game_screen_coords 2@ 3@
03E3: set_texture_to_be_drawn_antialiased 4@
  if and
  6@ == 0xF21C00
  5@ == 0xF21C00
  then
  038D: draw_texture 4@ position 2@ 3@ size 12.0 12.0 RGBA 200 0 0 255
  else
  038D: draw_texture 4@ position 2@ 3@ size 12.0 12.0 RGBA 255 255 255 255
  end
0AB2: ret 0   


//0AB1: call_scm_func @WasPlayerHit 1 Actor handle $PLAYER_ACTOR _returned 1@ _weaponDrawNumber 3@ // 1@ = 1 means that hit, 1@ == 0 means not hit
:WasPlayerHit
2@ = 0
if
031D:  actor 0@ hit_by_weapon 22 //Colt
then
2@ = 1
3@ = 2
else
  if
  031D:  actor 0@ hit_by_weapon 23 //Silenced
  then
  2@ = 1
  3@ = 11
  else
  if
  031D:  actor 0@ hit_by_weapon 24 //Deagle
  then
  2@ = 1
  3@ = 4
  else
  if
  031D:  actor 0@ hit_by_weapon 25 //Shotgun
  then
  2@ = 1
  3@ = 10
  else
  if
  031D:  actor 0@ hit_by_weapon 26 //Sawn
  then
  2@ = 1
  3@ = 9
  else
  if
  031D:  actor 0@ hit_by_weapon 27 //Combat shotgun
  then
  2@ = 1
  3@ = 3
  else
  if
  031D:  actor 0@ hit_by_weapon 28 //Uzi
  then
  2@ = 1
  3@ = 14
  else
  if
  031D:  actor 0@ hit_by_weapon 29 //Mp5
  then
  2@ = 1
  3@ = 7
  else
  if
  031D:  actor 0@ hit_by_weapon 30 //AK47
  then
  2@ = 1
  3@ = 1
  else
  if
  031D:  actor 0@ hit_by_weapon 31 //M4
  then
  2@ = 1
  3@ = 5
  else
  if
  031D:  actor 0@ hit_by_weapon 32 //Tec9
  then
  2@ = 1
  3@ = 13
  else
  if
  031D:  actor 0@ hit_by_weapon 33 //Rifle
  then
  2@ = 1
  3@ = 8
  else
  if
  031D:  actor 0@ hit_by_weapon 34 //Sniper
  then
  2@ = 1
  3@ = 12
  else
  if
  031D:  actor 0@ hit_by_weapon 38 //Minigun
  then
  2@ = 1
  3@ = 6
  end
  end
  end
  end
  end
  end
  end
  end
  end
  end
  end
  end
  end
end
0AB2: ret 2 2@ 3@
//0AB1: call_scm_func @PlayerActor_to_var 1 Actor handle $PLAYER_ACTOR Var 1@   
:PlayerActor_to_var
00A0: store_actor 0@ position_to 1@ 2@ 3@
0AB2: ret 1 0@
Calculator which makes calculations on maximum 4 numbers.

5Xyl1rE.jpg


Usage
Command:
/cc <formula>

Mathematical operators:
+ addition
- substraction
x and * multiplication
/ division

Examples of use:
/cc 2x2
/cc 2*2
/cc 2+2/2
/cc 2+2-2*2


Tested with
-Cleo 4.1
-Samp Functions 5.1
-MG Functions impossible 4.3
-SA-MP 0.3z R1


Limitations
-4 decimal spaces for fractions. (10/3 will give 3.333 instead of 3.33333333333333333333333333333333333333333333...)
-whole numbers input only (unability to do something like 1.1+1.1)
-no exponentiation/roots


Bugs
I had a crash while testing the dialog box but didn't remember the formula I used to analyse the problem. Please let me know if you have any crash, if anyone posted what exact formula causes the problem it would be great.


Additional info
The result keeps being displayed on the screen for 15 seconds after entering the command.


Source
http://pastebin.com/6QGDjQkt
It's a mod made for "Park Warden" job on "True RP server". It automatically drives to the checkpoints trying to avoid obstacles. It's customised specifically for this particular area/job so the mod by itself is not as useful as the source which can be modified by you for any purpose. If you look at the source it contains of 3 main parts.
1. "First" label - where the main work is done
2. "Change_Side" label - useful only for Glen Park to change sides without going into the water
3. Functions

Video:

Command:
/mow - activate/deactivate
You can also hold 0 to deactivate

Tested with:
-Cleo 4.1
-Samp Functions 5.1
-MG Functions impossible 4.3
-SA-MP 0.3z R1

Additional info:
It's not fully functional auto-driver which you can leave for hours while doing something else. After some time the car will eventually hit into the wall or go into the water. It can be solved by decreasing max speed, changing the entrance coordinates or improving obstacle detection

Source:
http://pastebin.com/MabNPbNp
Video:

Commands:
/chelp - displays commands
/cfind <modelID> - blue markers search
/cfind2 <modelID> - red markers search
/creset - resets searches
/ctog - hides searches

Tested with:
Cleo 4.1
Sampfuncs 4.0
MG funcs 4.3
Samp 0.3z R1

Additional info:
-the mod is limited to 15 cars per colour
-it looks like the model check in the script makes it laggy, if anyone is interested to improve it for example by making it work with 5-10 seconds breaks to avoid lag then the source is posted below

Source:
Код:
{$CLEO}
0000: NOP
0B34: samp register_client_command "cfind" to_label @cfind
0B34: samp register_client_command "cfind2" to_label @cfind2
0B34: samp register_client_command "ctog" to_label @ctog
0B34: samp register_client_command "creset" to_label @creset
0B34: samp register_client_command "chelp" to_label @chelp
7@ = 0
26@ = 0

:First
wait 0
if
0118:  actor $PLAYER_ACTOR dead
then
jump @First
end

if
056D:  actor $PLAYER_ACTOR defined
jf @First
30@ = 0

if
7@ == 1
then
jump @First
end

if 1@ == 1
then
0AB1: @Find_car 4 Car_model 11@ Display_offset 30@ Color 0x00C8FF Search_number 1
30@ += 43
end

if 2@ == 1
then   
0AB1: @Find_car 4 Car_model 12@ Display_offset 30@ Color 0xFF4800 Search_number 2
30@ += 43
end
jump @First

:cfind
wait 0
0B35: samp 29@ = get_last_command_params //
if 0AD4: 31@ = scan_string 29@ format "%d" 11@
then   
1@ = 1   
else  
0164: disable_marker 4@
1@ = 0
end
samp.CmdRet

:cfind2
wait 0
0B35: samp 29@ = get_last_command_params //
if 0AD4: 31@ = scan_string 29@ format "%d" 12@
then   
2@ = 1   
else  
2@ = 0
end
samp.CmdRet

:creset
wait 0
1@ = 0
2@ = 0
samp.CmdRet

:ctog
wait 0
0B12: 7@ = 7@ XOR 1
samp.CmdRet

:chelp
wait 0
0AF8: samp add_message_to_chat "{00C8FF}c{FF4800}a{00C8FF}r{F7F694}Finder commands:" color 0xFFFFFFFF
0AF8: samp add_message_to_chat "{FFFFFF}/cfind <modelID> {00C8FF}(blue markers)" color 0xFFFFFFFF
0AF8: samp add_message_to_chat "{FFFFFF}/cfind2 <modelID> {FF4800}(red markers)" color 0xFFFFFFFF
0AF8: samp add_message_to_chat "{FFFFFF}/creset {F7F694}(reset current searches)" color 0xFFFFFFFF
0AF8: samp add_message_to_chat "{FFFFFF}/ctog {F7F694}(tog current searches)" color 0xFFFFFFFF
samp.CmdRet

//0AB1: @Find_car 4 Car_model 0@ Display_offset y@ Color 2@ Search_number 3@
:Find_car   
3@ = 0
0B5A: get_screen_resolution 29@ 31@ //int
29@ /= 10
29@ *= 8
//31@ /= 2
31@ /= 10
31@ *= 7
005A: 31@ += 1@
28@ = 0
for 16@ = 0 to 2000
  if 0AFF: samp 10@ = car_handle_by_samp_vehicle_id 16@
  then
  0441: 11@ = car 10@ model   
  if 003B:  11@ == 0@  // (int)
  then
  03F0: enable_text_draw 1
  28@ += 1
  if
  02CA:  car 10@ bounding_sphere_visible
  then  
  0B66: render argb 2@ to_a 6@ r 7@ g 13@ b 14@
  0AB1: @Box_car 6 Car_handle 10@ Red 7@ Green 13@ Blue 14@ Alpha 255 Thickness 180.0
  end   
  end
  end  
  if 28@ > 14
  then break
  end   
end
0AD3: 8@v = format "Model: %d" 0@
0AD3: 12@v = format "Number: %d" 28@
  if
  28@ == 0
  then   
  0D94: draw_text 8@v pos_xy 29@ 31@ align_xy 0.0 0.0 color 0x575757 shadow 1
  31@ += 19
  0D94: draw_text 12@v pos_xy 29@ 31@ align_xy 0.0 0.0 color 0x575757 shadow 1
  else
  0D94: draw_text 8@v pos_xy 29@ 31@ align_xy 0.0 0.0 color 2@ shadow 1
  31@ += 19
  0D94: draw_text 12@v pos_xy 29@ 31@ align_xy 0.0 0.0 color 2@ shadow 1
  end
0AB2: ret 0


//0AB1: @Box_car 6 Car_handle 1@ Red 2@ Green 3@ Blue 4@ Alpha 5@ Thickness 6@
:Box_car
00AA: store_car 0@ position_to 11@ 12@ 13@
068D: get_camera_position_to 21@ 22@ 23@
050A: 24@ = distance_between_XYZ 11@ 12@ 13@ and_XYZ 21@ 22@ 23@
25@ = 1800.0
26@ = 1000.0
0073: 25@ /= 24@ // (float)
0073: 26@ /= 24@
0073: 5@ /= 24@
0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 11@ Y 12@ Z 13@ store_screen_X_to 14@ Y_to 15@
0AB1: @DRAW_OUTLINED_BOX 9 POS 14@ 15@ SIZE 25@ 26@ RGBA 1@ 2@ 3@ 4@ THICKNESS 5@
0AB2: ret 0

//0AB1: @DRAW_OUTLINED_BOX 9 POS 300.0 300.0 SIZE 50.0 50.0 RGBA 255 0 0 255 THICKNESS 0.5
:DRAW_OUTLINED_BOX
0087: 14@  = 8@ // (float)
0087: 12@ = 2@ // (float)
0087: 13@ = 3@ // (float)
12@ /= 2.0 // (float)
13@ /= 2.0 // (float)
0087: 8@  = 0@ // (float)
005B: 8@ += 2@  // (float)
0063: 8@ -= 12@  // (float)
0087: 9@  = 0@ // (float)
0063: 9@ -= 2@  // (float)
005B: 9@ += 12@  // (float)
0087: 10@ = 1@ // (float)
005B: 10@ += 3@  // (float)
0063: 10@ -= 13@  // (float)
0087: 11@ = 1@ // (float)  by OpcodeXe
0063: 11@ -= 3@  // (float)
005B: 11@ += 13@  // (float)   
03F0: enable_text_draw 1   
038E: draw_box_position  8@ 1@  size 14@ 3@ RGBA 4@ 5@ 6@ 7@ //  links
038E: draw_box_position  9@ 1@  size 14@ 3@ RGBA 4@ 5@ 6@ 7@  // rechts
038E: draw_box_position  0@ 10@  size 2@ 14@ RGBA 4@ 5@ 6@ 7@  // oben
038E: draw_box_position  0@ 11@  size 2@ 14@ RGBA 4@ 5@ 6@ 7@  // unten
0AB2: ret 0

//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@
:getScreenXYFrom3DCoords
0AA7: call_function 0x70CE30 num_params 6 pop 6 clipNear 1 clipFar 1 yMult 7[member=21661]S[/member] xMult 6[member=21661]S[/member] outVector 2[member=21661]S[/member] inVector 0[member=21661]S[/member] result 29@
0073: 2@ /= 6@
0073: 2@ /= 4@
0073: 3@ /= 7@
0073: 3@ /= 4@
2@ *= 640.0
3@ *= 448.0
0AB2: ret 2 2@ 3@

showcarmodelID command:
/carmodelid
Mod which automatically says the text from INI file

Usage
/autosay <num> - spam the chosen sequence
/autosay <num> <delay> - spam with a delay (in milliseconds)
/autosaystop - stop the sequence (the same can be done by pressing 0)
/autosayreset - reset all the stuff from INI
/autosayreset <num> - reset only one sequence

Tested with
-Cleo 4.1
-Samp Functions 5.1
-MG Functions impossible 4.3
-SA-MP 0.3z R1

Default sequences set right now are:
1. Never gonna give you up - Rick Astley
2. Samuel L Jackson monologue from Pulp Fiction (Ezekiel 25-17)
3-10 Empty
Some time ago I made damage/cheat detector but the management of the server where I was playing didn't approve it because they thought it gives some unfair advantage.

I don't have idea nor motivation to make something different with this script so I release it, maybe someone will find it useful. It includes "authenticity code" generator and checker which is a pretty cool feature as it assures that the detection was made by using this particular Cleo mod, not some fake text displayer or photoshop edit. The password for checkcode command is "eagle" (/checkcode eagle).

Mechanism of action:
The mod detects player's shooting rate, current weapon, distance from enemy and number of accurate shots. Then it compares detected data with the results of the tests made for each weapon from specific distance stated in the script. (Tested on IMRP, shooting rate may be different on other servers). If the number of hits in a row with certain weapon from specific distance is over the limit then the data is displayed, the camera moves near both players, and F8 is pressed automatically. The video presents its mechanism of work so the limits for each wepons are set to minimum to maximise the number of detections just to show how it works. The mod is restricted to IMRP server by IP check at the begining of the script.(not anymore)
Tested with:
Cleo 4.1
Sampfuncs 3.1.2
MG functions 4.3

Video:
This mod shows who recently connected and disconnected from the server.

q6zclR4.png


Installation
1. Unpack winrar file
2. Put "INI" and "doorKeeper.cs" inside your Cleo folder
3. If you crash, make sure that you have the same software as stated below

Tested with
-Cleo 4.1
-Samp Functions 5.1
-MG Functions impossible 4.3
-SA-MP 0.3z R1

Switcher
/dk

Settings
To change the settings open the "INI" folder, then open the file inside it.
Auto on=1 (the mod is automatically turned on when you login)
Auto on=0 (opposite)
Max players on your server=300 (lower value = less lag. Btw if your server has for example 1000 slots but these slots are not used it's better to set low value, as low as possible)
How often checks will be made=10 (10 stands for seconds. More frequent checks = more lag)

Update
17/02/2015, V1.1 - changed the way it checks for players. Instead of checking all of them at once it spreads the checks over time

Source
http://pastebin.com/jy25Azz2
Bundle of other source codes for learning purposes

In case if any mod is causing crash make sure to get the same plugins/software as specified in the mod's description.

Regards
 

Вложения

  • cleo pack (monday).rar
    342.9 KB · Просмотры: 1,167

Vasek zhe

Известный
18
4
Что можно полезного извлечь? допустим TrollTools на DRP - сохраняешь позицию и прописываешь /lag все незанятые машины телепортирует в одну точку, а все кто в зоне стрима имеют 2-5 фпс. Тебя при этом кикает, но эффект буде пока админ незаспаунит машины
8nuq9Wc.png
D5S65sn.jpg
 
  • Нравится
Реакции: NIngaro