Snippets

If you want to get the IP Address,Subnet Mask,Default Gateway,DHCP Server,Primary WINS Server,Secondary WINS Server then use this snippet: const // put this const at the header of the code ADAPTERCAPACITY = 4096 // ADAPTERCAPACITY >= 640 * ADAPTERSCOUNT // make sure to count the number of adapters you have at your computer. IPOFFSETIPADDRESS = 0x1B0 // Current IP Address IPOFFSETSUBNETMASK = 0x1C0 // Subnet Mask IPOFFSETGATEWAY = 0x1D8 // Default Gateway IPOFFSETDHCPSERVER = 0x1E8 // DHCP Server IPOFFSETPWINSS = 0x200 // Primary WINS Server IPOFFSETSWINSS = 0x210 // Secondary WINS Server end const // used by GetMyLocalIP ADAPTERLIBRARY = 31@...
Since, 0AB5 do not work in Multi-Player. There is a simple method of taking nearest car with specific radius! 00A0: store_actor $PLAYER_ACTOR position_to 1@ 2@ 3@ // This will store the XYZ Position in Variable 1@ 2@ 3@ (X = 1@, Y = 2@, Z = 3@) 0AE2: 4@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 10.0 find_next 0 pass_wrecked 0 // random car in near point and Kinda useless but snippet is snippet! Constant radius i recommend is 9.0
Hi. I download Chat++ but it's not working for me. It's not even opening box where is Copy and other shiet. So can someone help how to use it or something. Adding file which is not working for me...
If you don't have SAMPFUNCS and needs to convert between Window Screen Coordinate System and Game Screen Coordinate System, try using these converter snippets:
:hellno: But that line will be strange when its moving  :okey: //0AB1: @DRAW_LINE 9 POS 10.0 10.0 _TO_ 200.0 310.0 RGBA 255 0 0 255 THICKNESS 1.0 :DRAW_LINE 0087: 11@ = 2@ // (float) 0087: 12@ = 3@ // (float) 0509: 10@ = distance_between_XY 0@ 1@ and_XY 2@ 3@ 10@ -= 37.0 {REMOVE STRANGE OFFSET AT END} 0063: 2@ -= 0@ // (float) 0063: 3@ -= 1@ // (float) 0604: get_Z_angle_for_point 2@ 3@  store_to 9@ 9@ += 84.0 005B: 0@ += 11@ 0@ /= 2.0    {MITTE} // get center pos 005B: 1@ += 12@ 1@ /= 2.0 03F0: enable_text_draw 1 074B: draw_texture 666 position 0@ 1@ scale 10@ 8@ angle 9@ color 4@ 5@ 6@ 7@ 0AB2: 0
With this snippet we can get nick name. Good luck... Explain with 0.3.7 .: {$CLEO .cs} 0000: repeat wait 0 until 0afa: WHILE TRUE wait 0 call @Get_LocalPlayer_Name 0 0@ chatmsg "%s" -1 0@ END :Get_LocalPlayer_Name /// 0AB1: call_scm_func @Get_My_NickName 0 0@ 0AA2: 0@ = loadLib "samp.dll" //samp base offset 0@ += 0x21A0F8 0A8D: 0@ = readmem 0@ sz 4 vp 0 //stInfo 0@ += 0x3CD 0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPools 0@ += 0x18 0A8D: 0@ = readmem 0@ sz 4 vp 0 //stPlayerPools 0@ += 0xA //szLocalPlayerName 0AB2: ret 1 0@ Snippets.: 0.3.7 :Get_LocalPlayer_Name /// 0AB1: call_scm_func @Get_LocalPlayer_Name 0 0@ 0AA2: 0@ = loadLib "samp.dll" //samp base offset 0@ += 0x21A0F8 0A8D: 0@ = readmem 0@ sz 4 vp 0...
//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 0@ Y 1@ Z 2@ store_screen_X_to 3@ Y_to 4@ :getScreenXYFrom3DCoords 0AC7: 14@ = var 0@ offset 0AC7: 15@ = var 3@ offset 0AC7: 16@ = var 6@ offset 0AC7: 17@ = var 9@ offset 0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@ 0007: 12@ = 640.0 0007: 13@ = 448.0 0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0 0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0 0093: 14@ = integer 14@ to_float 0093: 15@ = integer 15@ to_float 0073: 12@ /= 14@ 0073: 13@ /= 15@ 006B: 3@ *= 12@ 006B: 4@ *= 13@ 0AB2: ret 2 3@ 4@
With this snippet, you can generate a fabricated name from a random online player in the server: Player Name Spoofing is a method where in you Pretend to be other Player's Name. This type of trick is Mostly used to deceive other players that knows the target. There are many ways to Spoof nicknames. Interchanging letter "l or small L" and "I or big i" on player names. Can you tell the difference between letters "l and I" in SAMP? The Deception percentage is 100%. The Respective list have a Deception percentage of 100(n-(1/n))% where "n" is the length on the target nickname. So having a namelength of 10 will have a deception percentage of 90% Dot(.) Name Addition - adding extra dot at the beggining or at the end of the name. Numerical...
DIALOG 0AB1: @isDialogOpen 0 ret dType 0@ dId 1@ :isDialogOpen 0AA2: 1@ = "samp.dll" 1@ += 0x212A40 0A8D: 1@ = readMem 1@ sz 4 vp 0 0A8E: 2@ = 1@ + 40 0A8D: 2@ = readMem 2@ sz 4 vp 0 if 2@ == 1 then     0A8E: 3@ = 1@ + 44 //dialogType     0A8D: 3@ = readMem 3@ sz 4 vp 0     0A8E: 4@ = 1@ + 48 //dialogId     0A8D: 4@ = readMem 4@ sz 4 vp 0     0485: dialog_open     0AB2: ret 2 3@ 4@ else 059A: dialog_closed end 0AB2: ret 2 -1 -1 ChatInput 0AB1: @isChatOpen 0 :isChatOpen 0AA2: 1@ = "samp.dll" 1@ += 0x212A70 0A8D: 1@ = readMem 1@ sz 4 vp 0 1@ += 8 0A8D: 1@ = readMem 1@ sz 4 vp 0 1@ += 4 0A8D: 1@ = readMem 1@ sz 1 vp 0 if 1@ <> 0 then 0485: chat_open else 059A: chat_closed end 0AB2: ret 0
This Snippet will get any actor that is near the specified part of the screen. This snippet is actually advanced and hard to understand by some users. But I will try to Pinpoint its use: A 2D Rectangle somewhere within the screen will bound the area of where desired actors will be fetched. the Drawing of Rectangle is from TopLeft to BottomRight Inside the 2D Rectangle, the user has an option to pin a "Base Coordinate". This Base Coordinate will be the "Center of Radius" for fetching nearby actors. The Base Coordinate(_nearscreencoordXY) shall be within the 2D Rectangle. It has a parameter to IGNORE a specific Actor that will not be processed during the actor fetching. The Actor fetching is all screen based(bounded within the...
Gets the Point from an origin to target point with a specific distance offset. { gets the point towards another point with a specific offset Usage: 0AB1: @getpointwithpolaroffset 7 _fromXYZ 0@ 1@ 2@ _offsetdistance 3@ _towardsXYZ 4@ 5@ 6@ _storeXYZ 29@ 30@ 31@ Examples: 0AB1: @getpointwithpolaroffset 7 _fromXYZ 0@ 1@ 2@ _offsetdistance 1.0 _towardsXYZ 4@ 5@ 6@ _storeXYZ 29@ 30@ 31@ // pointA towards to pointB 0AB1: @getpointwithpolaroffset 7 _fromXYZ 0@ 1@ 2@ _offsetdistance -1.0 _towardsXYZ 4@ 5@ 6@ _storeXYZ 29@ 30@ 31@ // pointA away to pointB } :getpointwithpolaroffset // ~~~~~~~~~~~get z-angle towards the target with respect to world z angle 0087: 30@ = 5@ // Y2 0063: 30@ -= 1@ // Y1 0087: 31@ = 4@...
Code return: Screen resolution with float and int format . Everything depends which one you need use in your code... :getScreenResolution //0AB1: @getScreenResolution 0 ScreenX {Float} 0@ ScreenY {Float} 1@ ScreenX {int} 2@ ScreenY {int} 3@ 0A8D: 0@ = read_memory 0xC17044 size 4 virtual_protect 0 // (int) full screen X 0085: 4@ = 0@ // copy (int) full screen X 0093: 0@ = integer 0@ to_float 7@ = 640.0 // screen X 0A8D: 1@ = read_memory 0xC17048 size 4 virtual_protect 0 // (int) full screen Y 0085: 5@ = 1@ // copy (int) full screen Y 0093: 1@ = integer 1@ to_float 8@ = 448.0 // screen Y 0087: 2@ = 0@ // copy (float) full screen X 0087: 3@ = 1@ // copy (float) full screen Y 10@ = 1280.0 // screen X * 2 11@ = 896.0 // screen Y * 2 if 0@...
It affects in only 1 frame. It means that you have to call this in every frame and you can use this to any objects. :ATTACH // 0AB1: @ATTACH 6 AS_actor $PLAYER_ACTOR attach_to_object 0@ offset 0.0 0.0 0.0 on_bone 6 0A9F: 6@ = current_thread_pointer 000A: 6@ += 0x44 0A96: 7@ = actor 0@ struct 0085: 0@ = 7@ // (int) 000A: 0@ += 0x18 0A8D: 0@ = read_memory 0@ size 4 virtual_protect 0 0AA7: call_function 0x734A40 num_params 1 pop 1 0@ 0@ // _clumpGetFirstSkinAtomicHAnimHierarchy 0012: 5@ *= 0x4 000A: 5@ += 0x488 005A: 5@ += 7@ // (int) 0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0 000A: 5@ += 0x14 0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0 0A8D: 7@ = read_memory 0x7C51E0 size 4 virtual_protect 1 if 0039: 7@ == 0x424548B...
OK, because I always hack on servers. I use this snippet to change my name into a random/obfuscated string before I log out so that I will not get caught by admins.It is an awesome snippet for me. Idea: It can be integrated on cleo scripts that changes the player name everytime he joins a server... Interesting. { Usage: 0AC8: 0@ = allocate_memory_size 21 0AB1: call_scm_func @randomnamegenerator 2 _inoutname 0@ _charcount 20 0AD1: show_formatted_text_highpriority "%s" time 2000 0@ 0AC9: free_allocated_memory 0@ NOTICE: - THE ALLOCATED MEMORY MUST BE GREATER THAN THE CHARACTER COUNT! As you can see on the example usage the allocated is 21 and the charcount is 20, you can set more than 21 allocated...
Computes the arctangent angle in the Euclidean plane, given in radians. atan2 is far more superior because atan can only return an angle of -90 to +90 degrees or -pi/2 to pi/2. atan2 is mostly used on "Aimbots". I always use atan2 beside of atan when I am dealing with geometric computaions. Method 1 SCM-Function: { computes atan2(y,x) where y = 0@ , x = 1@ Usage: 0AB1: @atan2 2 _floatY 23@ _floatX 5@ _floatresult 14@ // 14@ = atan2(23@,5@) where 14@ is in radians format 14@ *= 57.295779817106167876798171061675 // 14@ in degrees format(optional) } :atan2 if 1@ <> 0 then 0087: 30@ = 0@ // (float) 0073: 30@ /= 1@ // (float) 0C08: math 31@ = arctangent 30@ // (float) if 1@ < 0 // a -x value then if 0@ < 0...
Requires SAMPFUNCS Detects if a samp streamed player/actor is dead/alive: // Usage: // only use as conditional statements // if 0AB1: @playerstatesamp 3 _actor 31@ _player -1 _checkifdead true // if 0AB1: @playerstatesamp 3 _actor 31@ _player -1 _checkifdead false // if 0AB1: @playerstatesamp 3 _actor -1 _player 31@ _checkifdead true // if 0AB1: @playerstatesamp 3 _actor -1 _player 31@ _checkifdead false // DO NOT USE THIS FUNCTION WIth AND/OR GATES // if or // INACCURATE RESULT! // 0AB1: @playerstatesamp 3 _actor 31@ _player -1 _checkifdead true // ..... blablabla // // if and // INACCURATE RESULT! // 0AB1: @playerstatesamp 3 _actor 31@ _player -1 _checkifdead true // ..... blablabla :playerstatesamp // this...
Dunno if made already, couldn't find it so made one what is this used for?: spamming chat sources used: LukasParazitas http://ugbase.eu/index.php?threads/help-reading-a-string.20798/#post-121582 (I dunno how to make functions in cleo so i just copy pasted his and adjusted it) //EXAMPLE alloc 0@ 256 format 0@ "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM123456789" alloc 1@ 121 // always alloc 1 more byte than length for '\0' 0AB1: call_scm_func @random_string param_count 3 string 0@ length 120 text_start_pointer 1@ :random_string { 0@ = string 1@ = length 2@ = text start pointer } 0C17: 3@ = strlen 0@ for 4@ = 0 to 1@ 0085: 5@ = 0@ 0209: 6@ = random_int_in_ranges 0 3@ 005A: 5@ += 6@ 0A8D: 7@ =...
Many of you probably C+P'ed the "addClientCommand" out of mod_sa, it's easy to use and has one annoying thing to it.. It is the internal SA:MP limit of commands, you can actually bypass this pretty easy and do your own "command handler" which will also classify you as !337 l33t hax0r. First you need to know how SA:MP handles commands, basically if the input text of the editcontrol on the chatgui contains a "/" it scans through the internal list of commands and if it can't find one it'll send the request to the server. This is where we come in, it's actually pretty easy to go between the call and do your own magic. Today I will present you how, you should have a little experience tho I won't bother explaining everything here. Step one...
Function: 0AB1: @POSITION_TO_RADAR 7 XYZ 0.0 0.0 0.0 RADAR_POS 400 400 DISTANCE_MULTIPLIER 1.5 MAX_DISTANCE 300.0 _STORE_TO 1@ 2@ This function converts 3D position to 2D Radar position like on the Minimap. You can make things like this: http://i.san-mp.de/i/26CEA9.webm Source: {$CLEO .cs} 0000: REPEAT     WAIT 0 UNTIL 0AFA:  SAMP_IS_READY 0B6D: 5@ = create_font "Arial" height 10 flags 0x4 0BFC: SET_VAR "MadeByOpcodeXe" = 5@ WHILE TRUE     WAIT 0     FOR 31@ = 0 TO 1000         IF         0B23:  samp is_player_connected 31@         THEN             IF             0B20: samp 30@ = actor_handle_by_samp_player_id 31@             THEN                 0AB1: @GET_BONE_POS 2 FROM_ACTOR $PLAYER_ACTOR BONE 6 _STORE_TO 5@ 6@...
call @SendFakeSpecSync 3 0@ 1@ 2@ :SendFakeSpecSync Actor.StorePos($PLAYER_ACTOR, 0@, 1@, 2@) alloc 3@ 18 0C0D: struct 3@ offset 0 size 2 = 0 // sLeftRightKeys; 0C0D: struct 3@ offset 2 size 2 = 0 // sUpDownKeys; 0C0D: struct 3@ offset 4 size 2 = 0 // sKeys; 0C0D: struct 3@ offset 6 size 4 = 0@ //fPosition[X]; 0C0D: struct 3@ offset 10 size 4 = 1@ // fPosition[Y]; 0C0D: struct 3@ offset 14 size 4 = 2@ //fPosition[Z]; 0B3D: raknet 4@ = new_bit_stream 0B40: raknet bit_stream 4@ write 212 type 0 size 1 0B40: raknet bit_stream 4@ write 3@ type 5 size 18 0B8B: raknet send bit_stream 4@                0B3E: raknet delete_bit_stream 4@ free 3@ ret 0 Useful for trolling admins with your fake spectator mode and getting synced invisible.
Example {$CLEO .cs} 0000: wait 8500 while true wait 0 if 0256: player $PLAYER_CHAR defined then for 0@ = 0 to 175 // from 0 to max blip 0AB1: @GetRadarBlipInfo 1 BlipID 0@ _Return: ColorID 1@ RGB 2@ 3@ 4@ XYZ 5@ 6@ 7@ IconID 8@ if 8@ == 0 // Square/Triangle - mostly used to mark checkpoint or any place in server by owner then if 00DF: actor $PLAYER_ACTOR driving then 03C0: 9@ = actor $PLAYER_ACTOR car 00AE: set_car 9@ traffic_behaviour_to 2 00A7: car 9@ drive_to 5@ 6@ 7@ end end end end end :GetRadarBlipInfo { 0AB1: @GetRadarBlipInfo 1 BlipID 0@ _Return: ColorID 1@ RGB 2@ 3@ 4@...
OPCODE: 0B47: samp close_current_dialog_with_button 1@ Without SAMPFUNCS :CLOSE_DIALOG { 0.3.7 - R3 0AB1: @CLOSE_DIALOG 1 Button 0 // 0 = Left , 1 = Right } IF 0AA2: 10@ = "samp.dll" THEN 0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET 0A8D: 12@ = readMem 11@ sz 4 vp 0 0A8E: 11@ = 10@ + 0x6FF40 //SAMP_DIALOG_CLOSE 0AA8: call_function_method 11@ struct 12@ num_params 1 pop 0 0@ $NOT_USED END 0AB2: 0 :CLOSE_DIALOG { 0.3.DL 0AB1: @CLOSE_DIALOG 1 Button 0 // 0 = Left , 1 = Right } IF 0AA2: 10@ = "samp.dll" THEN 0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET 0A8D: 12@ = readMem 11@ sz 4 vp 0 0A8E: 11@ = 10@ + 0x700D0 //SAMP_DIALOG_CLOSE 0AA8: call_function_method 11@...
const SAMP_CHAT_INFO_OFFSET = 0x212A6C //0.3z end :getChatEntryText // 0AB1: call @getChatEntryText 1 id 0@ to 1@ { In 0@ - number of chat line. 99 line is last. Out 1@ - line text } 0AB1: call @GetSampBase 0 1@ 1@ += SAMP_CHAT_INFO_OFFSET 0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0 1@ += 0x136 0@ *= 252 // size of stChatEntry 005A: 1@ += 0@ // (int) 1@ += 28 0AB2: ret 1 1@ :GetSampBase 0AA2: 31@ = load_library "kernel32.dll" // IF and SET 0AA4: 30@ = get_proc_address "GetModuleHandleA" library 31@ // IF and SET 0AA7: call_function 30@ num_params 1 pop 0 "samp.dll" 0@ 0ab2: ret 1 0@ 0.3.7 :getChatEntryText IF 0AA2: 1@ = "samp.dll" THEN     1@ += 0x21A0E4     0A8D: 1@ readMem 1@ sz 4 vp 0     1@ += 0x132     0@ *= 0xFC    ...
Example: if or 044B: actor $PLAYER_ACTOR on_foot 00DF: actor $PLAYER_ACTOR driving then 0AB1: @GetClosestPickup 0 XYZ 0@ 1@ 2@ 06D5: 29@ = create_racing_checkpoint_at 0@ 1@ 2@ point_to 0@ 1@ 2@ type 2 radius 1.0 wait 1000 06D6: disable_racing_checkpoint 29@ end 0AB1: @GetClosestPickup 0 XYZ 0@ 1@ 2@ :GetClosestPickup 20@ = 9999.0 for 30@ = 0x9788C0 to 0x97D620 step 0x20 if 30@ > 0 then 0A8E: 31@ = 30@ + 0x1A 0A8D: 31@ = read_memory 31@ size 2 virtual_protect 0 31@ *= 0x10000 0A8F: 29@ = 30@ - 0x9788C0 29@ /= 0x20 005A: 31@ += 29@ 065B: store_pickup 31@ position_to 4@ 5@ 6@ 04C4: store_coords_to 7@ 8@ 9@ from_actor $PLAYER_ACTOR...
So.. you're making a CLEO and hate it to restart your Gta Sa all the time to test the new .cs? Well, here's the solution: 0AB1: @RESTART 1 WITH_KEY 88 // KEY_X Paste that function in the main loop of your cleo, now when u press X ingame, the new .cs gets loaded. ++ RENAME YOUR CLEO MOD TO: TEST.CS :RESTART IF 0AB0: 0@ THEN     REPEAT         WAIT 0         PRINT "~R~RESTART: ~w~TEST.CS" 100     UNTIL 8AB0: 0@ 0A92: RESTART "TEST.CS" 004E: STOP THIS CLEO END 0AB2: 0
Top