SA-MP Forums Archive
[FilterScript] [0.3e+]Player Attached Object Editor - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+--- Thread: [FilterScript] [0.3e+]Player Attached Object Editor (/showthread.php?tid=416138)

Pages: 1 2


[0.3e+]Player Attached Object Editor - RoboN1X - 16.02.2013

Rate ^ | Latest stable version: 0.4 - November, 2015
Player Attached Object Editor
This filter-script is useful for creating and editing a player attached object (also known as attached object, holding object, player attachment, clothes, dress, toy) on the player character/skin. Create up to 10 attached objects directly in game, adjust them with cursor, save, load, or share and make it together with other player(s) in the server. After it's saved, you can copy and paste the code to your SA:MP PAWN script or load them again to edit it. This is just like the attachments editor script made by h02, but with more commands and functions. Please note that this is not an attachment system, but an editor script.

Features Screenshots
Download
Just pick compiled code if you are just going to use it and not to develop it.
Version
Date
Compiled Script
Source Code
License
0.4
recommended
November, 2015 AOE4.amx (±313 KB, 0.3.7-1000p)MPL 2.0
0.3
old
March, 2014 AOE3.amx (±207 KB, 0.3z-500p)
CC BY-NC-SA 3.0
0.2
unstable
July, 2013N/A Download via PastebinCC BY-NC-SA 3.0
0.1b
old
March, 2013N/A Download via PastebinListed in code
0.1a
unstable
February, 2013N/A Download via PastebinListed in code
0.1
unstable
February, 2013N/A Download via PastebinListed in code
Requirements
Version
Compiled Script
Source
0.4
—————
0.3
  1. SA:MP server package (Windows/Linux) version 0.3e or newer
  2. sscanf plugin (v2.8.1+)
  1. SA:MP server package with pawncc (Windows) version 0.3e or newer
  2. sscanf plugin + include (v2.8.1+)
  3. zcmd include (v0.3.1)
0.2
0.1b
0.1a
0.1
  1. SA:MP server package (Windows/Linux) version 0.3e or newer
  1. SA:MP server package with pawncc (Windows) version 0.3e or newer
  2. Dini include (v1.6)
Usage & Installation
Installation
  1. Make sure you have downloaded the compiled code (.amx) of the newest version from the link above
  2. Place the AMX file to your "\filterscripts\" folder in the sa-mp server directory
  3. If you are using version 0.3 or 0.4, make sure sscanf plugin is loaded, you should see this on server.cfg file:
    • Windows:
      Code:
      plugins sscanf
    • Linux:
      Code:
      plugins sscanf.so
  4. Load and run the filter-script,
    • If the server is not running yet, place the AMX file name on the server.cfg file, example:
      Code:
      filterscripts AOE4
      And then start the sa-mp server
    • If the server is already running, send this server console/RCON command:
      Code:
      loadfs AOE4
  5. Once it's done, you should get this on server console/log:
    Quote:

    Attached Object Editor by Robo_N1X
    -------------loading--------------
    >> Version: 0.4 - November 2015 for SA:MP 0.3e+
    >> Player attached objects count: 0
    Filterscript 'AOE4.amx' loaded.

    Congratulations, this filter-script has successfully installed and loaded on your server.
Usage
After the filter-script is loaded, you can start by using /aoe command, this shows the main menu of the filter-script. Select "Help" to view the command list and its description. Additionally, login as RCON Admin to get more privileges such as deleting file and to bypass limit.

Command list and usages below, command in red means only for RCON admin: Legend: Sample
You probably need the sample of attached objects made with this editor. Here we go i made it, free demo!

Just copy the code below then paste on notepad and save the file with name "Flashlight_pao.txt" in scriptfiles folder by default, then you can try it in game by using command: /loadattachedobjects Flashlight
Code:
// Created by Robo_N1X (Skin ID 188) on 05/12/2015 19:16:52 (server time)
SetPlayerAttachedObject(playerid, 0, 18641, 6, 0.08, 0.04, 0.05, 180.0, 0.0, 0.0);
SetPlayerAttachedObject(playerid, 1, 18656, 6, 0.08, 0.065, 0.1, 90.0, 0.0, 0.0, 0.03, 0.03, 0.03);
SetPlayerAttachedObject(playerid, 2, 19281, 6, 0.08, 0.045, 0.175);
You can also just paste the code above directly to your own script without this editor.

Changelog
Code:
0.4 - November, 2015 (28/11/2015)
- License is now MPL 2.0
- Added #define for non-formatted text messages, makes it easier to edit the text
- Added #define AOE_SMALLER_SAVE to toggle skip writing optional value in code, makes the save file smaller
- Added code to automatically delete attached object made with the filter-script on unload, except for RCON admin
- Added /resetattachedobjecteditor command to reset player editor state in case of bug (admin only)
- Added /setattachedobjectmc command to set one or both attached object material color
- Added slot dialog options to select all slot
- Added slot selection and replace confirmation dialog for /refreshattachedobject
- Added dialog for /deleteattachedobjectfile command
- Added confirmation dialog for overwrite file save and other dialog types
- Added input dialog for editing XYZ value and Material Color data
- Added "Statistics" options to main menu dialog to show total attached objects, it shows debugging variable for RCON Admin
- Added code to prevent edit/adjusting over limit and cancel invalid/broken edit
- Added support for 0.3.7 objects
- Added a public function AOE_GetPVar() to get the player editor variable to be called with CallRemoteFunction()
- Changed the dialog id enumerations to #define method
- Bone names are now constant (read only)
- Repeated methods now uses one same function instead
- This version has many changes to commands, colors, messages.
- Changed the PVar method from function to variable (EPV)
- Changed the menu dialogs, now more simple and categorized
- Almost everything is well sorted to make it easy
- Attached object properties now previews material color better
- Changed the set XYZ command:
-- /setattachedobjectoffset(x/y/z) is now /setattachedobjectoffset [slot] [x/y/z]
-- /setattachedobjectrot(x/y/z) is now /setattachedobjectrot [slot] [x/y/z]
-- /setattachedobjectscale(x/y/z) is now /setattachedobjectscale [slot] [x/y/z]
- Fixed the bug that allows editor to restore invalid attached object
- Fixed the issue with loading comment from saved file
- Fixed some bugs and optimized code more better
- Removed command /totalattachedobjects, see "Statistics" on main menu instead.
0.3 - March, 2014 (29/03/2014)
- Major Bug fixes
-- Fixed the dialog
-- Fixed file name & data parsing for saving & loading
-- Fixed the material color data and formatting (Hex and Integer)
-- Fixed the function for player attached object related
-- Fixed some message typo/grammar
-- Fixed the wrong defined limit
-- Fixed valid object model id that was locked on the script and were unable to be used
- Code improvements, lower and efficient memory, also faster
-- Changed the size of variables to necessary value
-- Removed unused and old function
-- Changed the color to the new style
-- Changed the style of the script, including the defines, and variables
-- Removed dcmd from the command processor
-- Removed dini from file saving/loading player attached object file
-- Removed the dialog alert on deleting one player attached object, you can just use /udso to restore last deleted one
- Commands are changed to ZCMD and sscanf
- File saving/loading now use the default file function with sscanf
- Defined "FILTERSCRIPT" to make it works fine with the library
- Now you can write your own comment with /saveattachedobject(s) command, otherwise it will include common information such as creator name and time created
- Now you can see another player's attached object stats by using /attachedobjectstats command
- Now you can see the exact material color data on /attachedobjectstats and sample color on the text
- Added command /refreshattachedobject to load another player's attached object
- Added command /deleteattachedobjectfile for RCON Admin to delete an existing player attached object file
- Removed the /converattachedobjectfile, the /saveattachedobject(s) will save the code directly
- Changed the /loadattachedobject(s) method, it will read the data with correct SetPlayerAttachedObject usage from file, not compatible with older editor version
- Changes of credits
-- Added Scott as h02's another name
-- Added Zeex for the zcmd
-- Added Y_Less for the sscanf
-- Removed DracoBlue (for current version)
0.2 - July, 2013 (29/07/2013)
- Bug fixes
-- Fixed the valid data showing on /attachedobjectstats
-- Fixed the hex color data showing on /attachedobjectstats
- Changed the create method order from model, bone, slot to slot, model, bone
- Improved the dialog interfaces
-- Enabled some dialog back button, which was unused in the previous version
-- Removed the /attachedobjectlist command as it works like /editattachedobject
-- Added the /setattachedobjectindex into the dialog menu
-- Added the /setattachedobjectmodel into the dialog menu
-- Added the /setattachedobjectbone into the dialog menu
-- Added dialog confirmation on saving attached object to replace an existing file (RCON Admin Only)
-- Added the create button on /editattachedobject menu if the attached object is not created in the selected slot
- Removed variable "valid" from the file saving/loading
- Code optimization (lower memory), removed unused codes
0.1b - February, 2013 (28/02/2013)
- Minor updates and fixes
0.1a - February, 2013 (17/02/2013)
- Improved the /aoe menu dialog command
- Added dialog confirmation on /lao command for replacing used slot
0.1 - February, 2013 (16/02/2013)
- First release
Known Bugs
  1. It's written up to 99 characters can be saved for comment while its limited to 63 characters.
  2. Custom comments are not written in saved file.
License
Version 0.4 is released under Mozilla Public License 2.0:
https://www.mozilla.org/en-US/MPL/2.0/
You may not remove any credits in the script, especially the author(s) and contributor(s) name.
Although it's with MPL, but you might not sell this script as it violates the rules.

Credits
Credits & thanks to:Also thanks to: Milestone
Since 29/11/2015 this thread has been viewed more than 23,000 times:Total downloads are 6100, means 25% of the views.

Thanks to everyone that has used this filter-script tool, if you liked this editor, please rate the topic or post a comment, any feedback is appreciated.

F.A.Q
Which file should i download?
The important file everyone would have to pick is the .AMX file of the latest version (0.4) also the requirements files which one is sscanf plugin. You are only required to download source code if you are going to edit or compile the filter-script by yourself.

Can i use this script on my public server?
Yes you can, but please notice that this is not an attachment/holding object/toy/clothes system. This is an editor script, therefore every player in your server will be able to create, edit, save, load, and use the editor commands on any attached object freely, even not made by the editor script. You should only use it if your server allows free thing like mapping stuff, or in your own private/local server. If you do so, you should have reviewed the source code and edit it for your server needs.

The filter-script dialog id is conflicting with other script that i have.
This filter-script uses 32 dialog id starting from number 400, you have to edit the source code then find and change the number on this define part:
Code:
#define AOE_D	400	// Main Menu ID
For instance, if you changed the number from 400 to 1000, then dialog id 1000 to 1031 will be reserved for the editor.

Why am i getting error in game message "Sorry, you can't use this command right now."?
This filter-script does not allow the player to use most of editor commands if the player is in state such as (1) died, (2) spectating, (3) adjusting with cursor. You need to re-spawn for the first two cases, and save/cancel edit for the last case. Otherwise, in case of bug, you can login as RCON Admin and then use the /resetattachedobjecteditor command.

* More will be posted later

Additional Notes
You may use this script as much as is proper on San Andreas MultiPlayer, in other case, the author is not responsible of the risk and damage caused by this filter-script fault (no warranty), especially unauthorized source or fake mirror.

Please note that the download link for AOE4-03e-500p is compiled with 0.3e server for 500 players and might not work correctly on some conditions. However you should still able to use it on sa-mp server version 0.3e or newer with 500 player slot. This is provided for compatibility and lower memory as it is using necessary API version.

If you have found bugs or have any questions regarding to this script, feel free to reply here or send me a private message.
And sorry for my bad english both in the script and this forum thread.

More details of this topic will be updated later, i'm still editing it.


Re: [0.3e+][Dini]Player Attached Object Editor - radiobizza - 16.02.2013

gooooddd :X keep up


Re: [0.3e+][Dini]Player Attached Object Editor - WizBoy - 16.02.2013

Very usefull.....+1 Rep for you work


Re: [0.3e+][Dini]Player Attached Object Editor - XtremeR - 16.02.2013

Great Rep +!


Re: [0.3e+][Dini]Player Attached Object Editor - nhunor58 - 16.02.2013

nice I like it


Re: [0.3e+][Dini]Player Attached Object Editor - RoboN1X - 17.02.2013

Thank you all for the comments and using/downloading this filterscript
There is new minor change/update available! version 0.1a, tested in 0.3x
i don't have time right now on making the full guide. Feel free to ask me the question in this topic or forum pm.
Let me know if anyone have an idea or suggestion on this.


Respuesta: [0.3e+][Dini]Player Attached Object Editor - Drog - 15.03.2013

good


Re: [0.3e+][Dini]Player Attached Object Editor - Hoss - 16.03.2013

Great release robo


Re: [0.3e+][Dini]Player Attached Object Editor - Spaseto - 29.03.2013

Cool


Re: [0.3e+][Dini]Player Attached Object Editor - Androit - 06.07.2013

Nice Job Robo +Rep


Re: [0.3e+]Player Attached Object Editor - Stefhan - 04.03.2016

When I change the color of an object ( for ex 371 ) to 5000 ( green ) it doesn't change, the object just dissapears, how to fix?


Re: [0.3e+]Player Attached Object Editor - RoboN1X - 06.03.2016

Quote:
Originally Posted by Stefhan
Посмотреть сообщение
When I change the color of an object ( for ex 371 ) to 5000 ( green ) it doesn't change, the object just dissapears, how to fix?
Object 371 (parachute) has only single material. Therefore use the command /saomc1
Quote:

/setattachedobjectmc1
Alias: /saomc1
Change your attached object material color
Код:
/setattachedobjectoffset AttachedObjectIndex MaterialColor1
  • AttachedObjectIndex: The attached object slot number to change its material color
  • MaterialColor1: The new attached object #1 material color value
Also i'm not sure what you mean with 5000, perhaps try to use ARGB format instead, because you probably get used with integer that is equal with RGBA format, so if you want to make it green try FF00FF00.
Quote:

MaterialColor - The attached object texture material color as integer or hexadecimal number in ARGB format, e.g. 0xFF00FFFF.

Also please note that changing material colors doesn't support all indexes for holding objects, it's only limited to 2 by SA:MP so it may not work completely.


Re: [0.3e+]Player Attached Object Editor - Stefhan - 09.03.2016

Quote:
Originally Posted by RoboN1X
Посмотреть сообщение
Object 371 (parachute) has only single material. Therefore use the command /saomc1


Also i'm not sure what you mean with 5000, perhaps try to use ARGB format instead, because you probably get used with integer that is equal with RGBA format, so if you want to make it green try FF00FF00.

Also please note that changing material colors doesn't support all indexes for holding objects, it's only limited to 2 by SA:MP so it may not work completely.
Thanks, this worked, however I tried using code 0000000 to make something black but it became white.


Re: [0.3e+]Player Attached Object Editor - RoboN1X - 11.03.2016

Quote:
Originally Posted by Stefhan
Посмотреть сообщение
Thanks, this worked, however I tried using code 0000000 to make something black but it became white.
FF000000


Re: [0.3e+]Player Attached Object Editor - Greggu - 12.03.2016

For some reason whenever i'm done editing an attached object, the script will keep saying i have to finish the edit, even though i already pressed ESC.
The only solution to this is to reset the object editor, and when i do that i think the various offsets and values get reset to 0 so when i try to load saved objects i'll see the unedited version instead of the edited one.

Is there any solution to this?


Re: [0.3e+]Player Attached Object Editor - Ducati - 12.03.2016

Awesome.


Re: [0.3e+]Player Attached Object Editor - RoboN1X - 15.03.2016

Quote:
Originally Posted by Greggu
Посмотреть сообщение
For some reason whenever i'm done editing an attached object, the script will keep saying i have to finish the edit, even though i already pressed ESC.
The only solution to this is to reset the object editor, and when i do that i think the various offsets and values get reset to 0 so when i try to load saved objects i'll see the unedited version instead of the edited one.

Is there any solution to this?
I'm not sure why some people (still) facing this issue, i never able to find this, can anyone atleast explain the step what they are doing to produce this bug? I'd appreciate it.
When you save by clicking the disk icon, it should tell you that you have finished editing. Even if you pressed ESC it also notify you that object edit is canceled.
If it works for me correctly, it must be something from other script preventing the OnPlayerEditAttachedObject being called, because when i test it with a blank gamemode or grandlarc, with sscanf and with or without streamer plugins, nothing wrong.


Re: [0.3e+]Player Attached Object Editor - Iqba - 24.07.2016

doesnt work


Re: [0.3e+]Player Attached Object Editor - PolisManovic - 30.12.2016

Very nice


Re: [0.3e+]Player Attached Object Editor - murilo2929 - 16.11.2018

its possible to put this FS in GM?