[FilterScript] Live Map Editor [DINI/ZCMD]
#1

Hello!

Hey, I've decided to release this piece of code i've made about a year ago which is pretty useful and somewhat fun to use. Due to it's age I had not learned SQL back by then so the script will not feature SQL saving (althought by using DINI it is pretty simpler, If I did this again by now I wouldn't use SQL anyways)


Features

Live mapping tools for RCON administrators
The original version featured Per player objects (with very very very big arrays) but I don't like incredibly high memory allocations (the .amx was ... incredibly big) so I reduced it to be global objects, therefor the script is only supported for RCON admins since it uses objects globally including for loading and saving maps.

The tools include from creating objects and moving objects (obviously) to copying, swapping, deleting, exporting and loading maps / objects, also included material saving (up to three indexes) for each object.

Dynamic exporting commands
You can export your objects to a .ini file dynamically from the game and chose the function it uses to create the object, by this way, you can adapt your objects to any kind of object creation function (CreateObject, CreateDynamicObject, etc..). This also includes materials saving.

Loading/Saving maps (incl. materials!)
You can save the current objects to a file for later loading and editting. As mentioned this will also save any object material modification and will be loaded along with the objects when loading the whole map.

Easy usage
You don't really need to learn lots of commands. I've created a panel where you can edit objects in a similar way to external map editors, and to edit an object you can simply go into edit mode and move the object around without needing to use any command. Key support for copying and deleting objects is also included so when creating a map all you need to do is let your creativity flow.

In game object library
Can't find an object? The in game object library allows you to search objects by the name. I've manually added over 500 usefull objects into the list, so by simply typing "/obj barrel" you will get the IDS of any object in the library that has "barrel" in it's name.

In game object panel
As mentioned in the easy usage, there is an object panel:



It features (simple) common expresions when setting the position of the object (X,Y,Z, RX,RY,RZ), material applying, copying, saving, deleting, teleporting, model management, and even saving map and creating new objects. You just have to click on the field you wish to modify and it'll be applied to the object. This is extremly useful when you need perfect precission on coordinates, since the edit mode is not that perfect. (There are still commands todo this, though).
The textdraw is one of the very first complex textdraws I've created with selection so it is not of my best designs.

Complete set of commands

KEYS: <> requiered parameter, [] optional parameter.

Object Management
Код:
• /odestroy
- Destroy the current selected object.
* NOTE: Pressing KEY_CONVERSATION_NO (Default 'N') will delete the currently selected object.

• /odestroyall
- Destroys all the objects.

• /ocreate <model>
- Create a new object.

• /ogoto <slot>
- Teleport to the object.

• /myobjects
- List all the current created objects.

• /obj <name, part of name>
- Lists the objects IDs for the typed (part of) name.

• /osel <slot>
- Select an object.

• /osave
- Stops editting/unselects current object.

• /oedit [slot]
- Enters object edition mode if no slot typed, otherwise edits selected object.

• /oinfo [slot]
- Opens the object info panel. If any slot is inputted that object will be displayed.

• /oswap <new model>
- Swaps the currently selected object model's to the typed one.

• /ocopy
- Copies the currently selected object and creates a new object on it's place.
* NOTE: Pressing KEY_CONVERSATION_YES (Default 'Y') will automatically copy the currently selected object.
Object Movement

Код:
• /oy [Y]
- Move the currently selected object in the Y coordinate. Default is positive 1 unit.

• /oyall [Y]
- Move all the objects in the Y coordinate. Default is positive 1 unit.

• /ox [X]
- Move the currently selected object in the X coordinate. Default is positive 1 unit.

• /oxall [X]
- Move all the objects in the X coordinate. Default is positive 1 unit.

• /oz [Z]
- Move the currently selected object in the Z coordinate. Default is positive 1 unit.

• /ozall [Z]
- Move all the objects in the Z coordinate. Default is positive 1 unit.

• /ry [Y]
- Rotate the currently selected object in the Y coordinate. Default is positive 5 units.

• /ryall [Y]
- Rotate all the objects in the Y coordinate. Default is positive 5 units.

• /rx [X]
- Rotate the currently selected object in the X coordinate. Default is positive 5 units.

• /rxall [X]
- Rotate all the objects in the X coordinate. Default is positive 5 units.

• /rz [Z]
- Rotate the currently selected object in the Z coordinate. Default is positive 5 units.

• /rzall [Z]
- Rotate all the objects in the Z coordinate. Default is positive 5 units.

• /resetrx
- Resets the rotational X of the currently selected object to zero.

• /resetry
- Resets the rotational Y of the currently selected object to zero.

• /resetrz
- Resets the rotational Z of the currently selected object to zero.

• /omove <X> <Y> <Z> <Speed>
- Moves the currently selected object within it's position.

• /omoveall <X> <Y> <Z> <Speed>
- Moves all the objects within it's position.

• /omovetop <player> <speed>
- Moves the currently selected object (and makes it face) towards the selected player.

• /omovealltop <player> <speed>
- Moves all the objects (and makes them face) towards the selected player.

• /omoveto <X> <Y> <Z> <speed>
- Moves the currently selected object to the typed positions.

• /omoveallto <X> <Y> <Z> <speed>
- Moves all the objects to the typed positions.
Save/Load
Код:
• /exportmap <function> <mapname>
- Exports the selected map objects (& materials) into a file which uses the typed "function" to create the objects.

• /deletemap <mapname>
- Delete a map from the files.

• /savemap <mapname>
- Save all the currently created objects into a file.
* NOTE: You can use (Default GTA SA 'H') or click in the 'S' letter at /oinfo to perform a quick save of the last saved map.

• /loadmap <mapname>
- Deletes all the currently created objects and loads the one from the selected map.
Other
Код:
• /omat  <index> <model> [txd name] [texture name] [color (AGRB)]
- Changes the material of the currently selected object to the typed one. Optionals parameter are replaced by "None", "None" & "0" respectively.

• /otextmat <text>
- Changes the text material of an object.
* NOTE: Text material isn't saved with the materials.

• /otextmatset <index> [size(60)] [font(Arial)] [font size(24)] [bold(1)] [fontcolor (ARGB)] [backcolour (ARGB)]
- Sets the parameters of the text material. Background default is zero (black no transparency) and the Font default is white.
* NOTE: Text material isn't saved.

• /oclearmat <index>
- Clears the material from the selected index.
NOTES & OUTRO

Objects are global
If you and another admin edit the same object there will be conflicts. The system wasn't mean for this to happen so please avoid this at all times. Also, if another admin loads a map, all your current objects will be deleted, making this script essentially a working tool and not a fun tool (as I meant it to be).
Maybe in the future I will release the per player objects version (I do have it in another script).

YOU WILL NEED a 'maps' folder in your scriptfiles
Maps are saved/exported in that folder.

Edition mode is not near to be precise
I don't know why but the position isn't updated even if you move the object. If you look at the bottom bar you will notice that sometimes the actual coordinates don't change when moving the object. This can be fixed by waiting a few seconds or saving it by pressing the save icon. This is highly noticable when you copy the object by pressing Y.

Exporting materials
Materials are exported with SetDynamicObjectMaterial by default. If importing the code into your script you must change it depending if whether you use streamer or not.

Object panel (/oinfo)
> Clicking on the arrows at the 'slot' box will switch thru the objects and select the new object in the object panel.
> Clicking on the model box will open a dialog to change the model of the object.
> Clicking on any of the position boxes (X,Y,Z,RX,RY,RZ) will open a dialog that allows you to change the position precissely of the object. Supports simple common expresions on the first character (so you can do for example, -5, or *2)
> Clear index clears the material on the currently selected index.
> Apply to Index applies the current material info on the selected index.
> Clicking on any of the mat boxes opens up the dialog for the three save-able indexes. These are the indexes 0-2 included.
> Save button also works as a close button (Save doesn't really save the object, it just stops the edition for that object and unselects it)
> Clicking on the 'n' at the top allows you to create a new object, 's' saves all objects to the last saved map name (if none, it will not save), 'r' refreshes the object info and 'x' just closes the box.


This script is not pottus approved due to the use of PVars


Screens














Download & Instructions

If you want to change the max limit of objects change this at line 7
pawn Код:
#define MAX_PLAYER_OBJECTS      500
You should also change this at line 8
pawn Код:
#define PLAYERS                 24
The following includes are used
pawn Код:
#include <streamer>
#include <dini>
#include <sscanf2>
#include <ZCMD>

The following plugins are used
Streamer Plugin (2.7) https://sampforum.blast.hk/showthread.php?tid=102865
Sscanf Plugin (2.8.1) https://sampforum.blast.hk/showthread.php?tid=120356


You must create a folder named 'maps' in your scriptfiles directory.


Filterscript Download
(Only .pwn)
http://pastebin.com/JytrfBkt


Credits: Mike. Yep.


WARNING: The script is heavily untested and might have lots if not 100% bugged. Report any bug here.
Reply
#2

awesome nice work bro.
Reply
#3

This is super awesome dude. .
Nice Work!!!
Reply
#4

Excellent. Amazing work.
Reply
#5

I love it! one of the best
Keep it up!
Reply
#6

Nice work!!
Amazing!
Reply
#7

Definitely will use this, will post back with what I think, but I think this looks amazing. Great job.
Reply
#8

Good job.
Ill test it later but it looks great.
Reply
#9

The filterscript contenante all objects or just some ?
Reply
#10

Good Job. DOF2 Here
Convert DINI for DOF2 in SAMP Tool Maker
Reply
#11

NICE WOW
Reply
#12

It seems pretty cool. Good job there. +2
Reply
#13

Good Joob #Epic
Reply
#14

Those are some nice textdraws! Good job.
Reply
#15

Nice job man...

I think you are in love for textdraws now xD.
Reply
#16

Quote:
Originally Posted by PT
Посмотреть сообщение
Nice job man...

I think you are in love for textdraws now xD.
The potential of textdraws is incredibly high if used well since they've added the clickable and models callbacks; I really hope they add more GUI options in the future, doing a GUI with textdraws isn't hard but could be waaaay easier (althought all my work would be obsolete )


--

Thanks everyone
Reply
#17

good job bro!
Reply
#18

Код:
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\pawno\include\sscanf2.inc(151) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(850) : warning 217: loose indentation
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(851) : warning 217: loose indentation
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(858) : warning 217: loose indentation
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(868) : error 017: undefined symbol "hooked"
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(868) : error 029: invalid expression, assumed zero
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(868 -- 871) : warning 213: tag mismatch
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(868 -- 871) : warning 215: expression has no effect
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(871) : error 001: expected token: ";", but found "return"
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(871) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Help me fix these and in the "hooked"error i can find it it that line!
Reply
#19

Quote:
Originally Posted by Sojo12
Посмотреть сообщение
Код:
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\pawno\include\sscanf2.inc(151) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(850) : warning 217: loose indentation
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(851) : warning 217: loose indentation
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(858) : warning 217: loose indentation
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(868) : error 017: undefined symbol "hooked"
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(868) : error 029: invalid expression, assumed zero
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(868 -- 871) : warning 213: tag mismatch
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(868 -- 871) : warning 215: expression has no effect
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(871) : error 001: expected token: ";", but found "return"
C:\Users\HACKIFYOUCAN\Desktop\NEW\FunGaming Stunt-Freeroam\filterscripts\MAP.pwn(871) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Help me fix these and in the "hooked"error i can find it it that line!
I defined name somewhere in the script, change it to name2 or something like that and the function PlayerName to use name2 -- as for the rest I've never added anything named "hooked" inside of the script.
Reply
#20

OMG I was really searching for this. Really thank you bro
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)