tstudio.pwn 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. /*
  2. A
  3. ....
  4. ,DDDDDD ..DDDDDDD=... . .......
  5. DDDDDDD .DDDDDDDDDDDD. .~DDDD8:.
  6. ..DD.DDDDD DDDDDDZ.7DDDDD8. .7DDDDDDDDDDD.
  7. .. ..,DD..DDDDD....=DDDDDD...DDDDDD....DDDDDDDD.DDDDD..
  8. =.DDDD...DDD,D...DDDDDDD...DDDDDD...8DDDD$..8.ODDDD .
  9. ...Z.~8I..,D:.I.. .DDDDDD8...DDDDDD...DDDD...D,..8DDD8D.
  10. ...+DD...D. D...D.. .....D8DDDDDD..DDDD..O,D .DDD.+..
  11. .,DDDDD..=. =..D+8O .=DDDDDDDDDD...D8DD. .O$ .D...D..
  12. ..DDDD7..~+.~$.8...DD .:D.ODDDDDD8.. .DDDD8...8..D,...D~.
  13. DDDDDDDD=...~,...I8DD.DODDZ..8DD.,.. DDO88D........ID8D~
  14. DDDDDDDDDDID~DDDDDDDD.O.,D8..$..?... DD8Z...8.Z:,?...7I.
  15. +DDDDDDDDDDDDDDDDDDDD..Z..Z..8 .DDDDDDDD.8DDD88,=?:~..~?DD..
  16. .DDDDDDDDDDDDDDDDDDDD+ZD7.....+Z,+DDDDD+..DDDDD7$D$8?DDDD:..
  17. .DDDDDDDD8ZZZ8DDDDD8D.8.....+Z..=DDDDDD...DDDDDDDDDDDDDDD...
  18. ... .DDDDDD ..DDDDI?8DDDDDDDDD....DDDDDDDDDDDDZ.
  19. .8DDDDD....DD8DO$Z??$$ODDDD. .?DDDDDDDDD.
  20. ........................ .. ............
  21. Production
  22. _______ _ _____ _ _ _
  23. |__ __| | | / ____| | | (_)
  24. | | _____ _| |_ _ _ _ __ ___ | (___ | |_ _ _ __| |_ ___
  25. | |/ _ \ \/ / __| | | | '__/ _ \ \___ \| __| | | |/ _` | |/ _ \
  26. | | __/> <| |_| |_| | | | __/ ____) | |_| |_| | (_| | | (_) |
  27. |_|\___/_/\_\\__|\__,_|_| \___| |_____/ \__|\__,_|\__,_|_|\___/
  28. Texture Studio v1.9g by [uL]Pottus and Crayder
  29. You may modify and re-release this this script if you please just rememeber the
  30. mule who built it!
  31. About Texture Studio:
  32. Well after releasing the texture viewer and getting back a lot of positive feedback
  33. I couldn't help but one up myself. The challange create a companion map editor using
  34. all the techniques I've learned with SA-MP scripting to create an extensible mapping
  35. script as fast as possible. Basically that means texture studio was built in one day
  36. but I of course I had some good reference code from medit and in fact this script
  37. works very similarily to medit but with a greatly enhanced core design.
  38. Commands: (Currently 65 commands)
  39. Maps:
  40. /loadmap - Load a map
  41. /newmap - Create a new map
  42. /importmap - Import CreateObject() or CreateDynamicObject() raw code
  43. /export - Export a map to code or vehicle
  44. Objects:
  45. /cobject <objectid> - Create an object
  46. /dobject - Delete your selected object
  47. /robject - Resets an objects text and materials
  48. /osearch - Search for a object
  49. /sel <objectid> - Select a object id index
  50. /csel - Use the mouse to select an object
  51. /lsel - Use a list / preview to display objects
  52. /flymode - Enter flymode
  53. /ogoto - Goto your selected object (must be in flymode)
  54. /pivot - Set a pivot position to rotate objects around
  55. /togpivot - Turn on/off pivot rotation
  56. /oprop - Object property editor
  57. Movement:
  58. /editobject - Edit object mode
  59. /ox - /oy - /oz - Standard movement commands
  60. /rx - ry - /rz - Standard rotation commands
  61. /dox - /doy - /doz - Delta move map
  62. /drx - /dry - /drz - Rotate map around map center
  63. Textures/Text/Indexes/Theme:
  64. /mtextures - Show a list of textures in a list
  65. /ttextures - Show a list of textures in (Theme)
  66. /stexture - Texture editor
  67. /mtset <index> <textureref> - Set a material
  68. /mtsetall <index> <textureref> - Set a material to ALL objects of the same modelid
  69. /mtcolor <index> <Hex Color ARGB> - Sets a material color
  70. /mtcolorall <index> <Hex Color ARGB> - Sets a material color to ALL objects of the same modelid
  71. /copy - Copy object properties to buffer from currently selected object
  72. /paste - Paste object properties from buffer to currently selected object
  73. /clear - Clear object properties from buffer
  74. /text - Open the object text editor
  75. /sindex - Set text on a object will show material IDs
  76. /rindex - Removes material indexes shown on an object
  77. /loadtheme - Load a texture theme
  78. /savetheme - Saves a texture theme
  79. /deletetheme - Delete a texture theme
  80. /tsearch - Find a texture by part of name
  81. Groups/Prefabs:
  82. /setgroup - Sets a group id for a group objects
  83. /selectgroup - Select a group of objects to edit
  84. /gsel - Open up click select to add/remove objects from your group
  85. /gadd - Add an object to your group useful for objects that cannot be clicked on
  86. /grem - Remove a specific object from your group
  87. /gclear - Clear your group selection
  88. /gclone - Clone your group selection
  89. /gdelete - Delete all objects in your group
  90. /editgroup - Start editing a group
  91. /gox - /goy - /goz - Stardard group movement commands
  92. /gox - /goy - /goz - Stardard group rotation commands
  93. /gaexport - Exports a group of objects to a attached object FS (Not yet completed)
  94. /gprefab - Export a group of objects to a loadable prefab file
  95. /prefabsetz - Set the load offset of a prefab file
  96. /prefab <LoadName"> - Load a prefab file, /prefab will show all prefabs
  97. /0group - This will move all grouped objects center to 0,0,0 useful for getting attached object offsets (Not in the GUI yet)
  98. Vehicles:
  99. /avmodcar - Mod a car it will teleport the vehicle to the correct mod garage if modable
  100. /avsetspawn - Set the spawn position of a vehicle
  101. /avnewcar - Create a new car
  102. /avdeletecar - Delete an unwanted car
  103. /avcarcolor - Set vehicle car color
  104. /avpaint - Set a vehicles paintjob
  105. /avattach - Attach currently selected object to currently selected vehicle
  106. /avdetach - Detach currently selected object from vehicle
  107. /avsel - Select a vehicle to edit
  108. /avexport - Export a car to filterscript
  109. /avexportall - Export all cars to filterscript
  110. /avox - /avoy - /avoz - Standard vehicle object movement commands
  111. /avrx - /avry - /avrz - Standard vehicle object rotation commands
  112. /avmirror - Mirror currently selected object on vehicle
  113. (Special note: using /editobject on an attached object will edit the object on the vehicle)
  114. Bind Editor:
  115. /bindeditor - Open the bind editor you can enter a series of commands to execute
  116. /runbind <index> - Runs a bind
  117. Other:
  118. /echo - Will echo back any text sent this is useful for autohotkey so that you can create
  119. displayed output for your keybinds
  120. Keycombos:
  121. /csel:
  122. Holding 'H' while clicking an object will copy properites to buffer
  123. Holding 'Walk Key' while clicking an object will paste properties from buffer
  124. /editgroup:
  125. Hold 'Walk Key' to set the group rotation pivot you can only do this once per edit
  126. GUI:
  127. When in fly mode to open the GUI press 'Jump Key' otherwise it can be opened by pressing 'N' Key
  128. Texture Viewer:
  129. In Fly mode instead of pressing Y/H to scroll through textures hold enter/exit vehicle and press ANALOG Left ---- ANALOG Right
  130. Pressing sprint will add textures to your theme in fly mode press sprint+aim to add textures to theme in walk mode
  131. Walk key will apply the selected texture to your object
  132. Change Log:
  133. v1.0 - First release
  134. v1.1 - Updated features
  135. - Fixed a bug with OnPlayerEditDyanmicObject()
  136. - Added some new commands to texture or color all like objects
  137. - Added text editing support (New map files will not be compatible)
  138. - Whole map movement/rotation
  139. - Texture viewer is now in compiled into this FS
  140. v1.2 - Added support for importing RemoveBuildingForPlayer() this will be saved to DB
  141. - Can now copy/paste texture and text from one object to another
  142. v1.3 - Complete GUI implementation that calls all commands
  143. - Groups added you can edit group selections
  144. - Texture editor texture objects with a GUI
  145. - You can make your own texture themes
  146. - Prefabs can be saved/loaded
  147. - Texture themes can now be created "default_theme" is always loaded when a player connects
  148. - You can make your own command based binds and execute them
  149. v1.4 - New command /lsel gives a new advanced object selection method
  150. - Fix a spelling mistake in the gui
  151. - Added /oprop command to directly edit all object properties
  152. - Map exporting now has a option for CreateDynamicObject() instead of CreateDynamicObjectEx()
  153. v1.5 - Greatly enhanced /osearch command
  154. v1.5a - Added a feature to clone in edit object mode simply press 'walk' to clone the object
  155. - You can press enter/exit vehicle to save a objects position in edit object mode
  156. v1.5b - Added /obmedit command an object metric tool
  157. v1.5c - Improved object metric tool to include rotation translations
  158. - Added degree option to object metric tool
  159. v1.5d - Minor update to object metric tool to set object orientation for rotation translation
  160. v1.5e - Important fix
  161. v1.6 - Editable vehicles
  162. - A few bug fixes with texturing and overlapping key presses with other systems
  163. v1.6a - New command /tsearch search for textures useful for finding the index of a known texture
  164. v1.6b - Added feature to export map including cars to filterscript
  165. - New command /avmirror mirror objects on a car
  166. - Completely rebuild the all objects array some where missing it should be complete now
  167. v1.6c - Text length is now 128 characters and will accept \n for new line
  168. - Fixed a issue with folders now showing on github
  169. v1.6d - Fixed an issue with exporting objects if an object had text the parameters were out of order
  170. - Any object should be able to be created now there even LOD
  171. - Re-organized the project slightly
  172. v1.7 - /undo command (Note you can't undo edits on vehicles currently)
  173. */
  174. /* NONE MAJOR MINOR PATCH
  175. - 0x 00 00 00 00
  176. - Major: X.00 (# 1-10)
  177. - Minor: 0.X0 (# 1-10)
  178. - Patch: 0.0X (Letter a-z, not A-Z)
  179. */
  180. #define TS_VERSION (0x00010907)
  181. #define FILTERSCRIPT
  182. // Uncomment to turn on DEBUG mode
  183. // #define DEBUG
  184. // #define GUI_DEBUG
  185. // Compile the Angular Map Extension module
  186. //#define COMPILE_MANGLE
  187. // Compile the local input module for advanced keys and mouse control
  188. //#define COMPILE_LOCAL_INPUT
  189. #if defined DEBUG
  190. #define DB_DEBUG true
  191. #define DB_QUERY_ERRORS true
  192. #endif
  193. // Includes
  194. #include <a_samp>
  195. // Set max players
  196. #undef MAX_PLAYERS
  197. #define MAX_PLAYERS 10
  198. // "tsfunc" definition, to replace "stock"
  199. #define tsfunc
  200. // System defines
  201. #define BroadcastCommand(%0,%1) CallLocalFunction("OnPlayerCommandText","is",%0,%1)
  202. // System includes
  203. #include <sqlitei>
  204. #include <formatex>
  205. #include <strlib>
  206. // Plugins
  207. #include <streamer>
  208. #include <filemanager>
  209. #include <sscanf2>
  210. // GUI System
  211. #include "tstudio\gui\guisys.pwn"
  212. // YSI
  213. #include <YSI\y_iterate>
  214. #include <YSI\y_inline>
  215. #include <YSI\y_dialog>
  216. #define Y_COMMANDS_NO_IPC
  217. #include <YSI\y_commands>
  218. // All SA Textures
  219. #include "tstudio\alltextures.pwn"
  220. // Valid SA models
  221. #include "tstudio\validmodels.pwn"
  222. // Model sizes
  223. #include "tstudio\modelsizes.pwn"
  224. // Include 3D Menus (By SDraw)
  225. #include "tstudio\3dmenu.pwn"
  226. // Command Buffer
  227. #include "tstudio\cmdbuffer.pwn"
  228. // Common functions
  229. #include <functions>
  230. // Colors
  231. #define STEALTH_GREEN 0x33DD1100
  232. #define STEALTH_ORANGE 0xFF880000
  233. #define STEALTH_YELLOW 0xFFFF00AA
  234. // Maximum number of objects
  235. #define MAX_TEXTURE_OBJECTS 10000
  236. // Maximum number of remove buildings (Anymore than 1000 will likely crash GTA)
  237. #define MAX_REMOVE_BUILDING 1000
  238. // Maximum of editable materials (16 is the limit even if set higher)
  239. #define MAX_MATERIALS 16
  240. // Highlight color for an object
  241. #define HIGHLIGHT_OBJECT_COLOR 0xFFFF0000
  242. // Maximum text length
  243. #define MAX_TEXT_LENGTH 129
  244. // Max Groups
  245. #define MAX_GROUPS 201
  246. // 3D Text drawdistance
  247. new Float:TEXT3D_DRAW_DIST = 100.0;
  248. // Vehicle attach update types
  249. #define VEHICLE_ATTACH_UPDATE 0
  250. #define VEHICLE_REATTACH_UPDATE 1
  251. forward OnPlayerObjectSelectChange(playerid, index);
  252. forward OnObjectUpdatePos(playerid, index);
  253. forward OnUpdateGroup3DText(index);
  254. forward OnDeleteGroup3DText(index);
  255. // ARGB
  256. #define ARGB(%0,%1,%2,%3) ((((%0) & 0xFF) << 24) | (((%1) & 0xFF) << 16) | (((%2) & 0xFF) << 8) | (((%3) & 0xFF) << 0))
  257. // Edit check makes sure the player is actually editing an object before doing certain commands
  258. #define EditCheck(%0); if(CurrObject[%0] == -1) { \
  259. SendClientMessage(playerid, STEALTH_ORANGE, "______________________________________________"); \
  260. return SendClientMessage(playerid, STEALTH_YELLOW, "You need to select an object to use this command"); }
  261. // Don't let player use command if they are editing an object
  262. #define NoEditingMode(%0); if(EditingMode[%0]) { \
  263. SendClientMessage(playerid, STEALTH_ORANGE, "______________________________________________"); \
  264. return SendClientMessage(playerid, STEALTH_YELLOW, "You need to finish editing your object before using this command"); }
  265. // Checks if a map is open
  266. #define MapOpenCheck(); if(!MapOpen) { \
  267. SendClientMessage(playerid, STEALTH_ORANGE, "______________________________________________"); \
  268. return SendClientMessage(playerid, STEALTH_YELLOW, "There is no map currently open"); }
  269. // Removebuilding information enum
  270. enum REMOVEINFO
  271. {
  272. rModel,
  273. Float:rX,
  274. Float:rY,
  275. Float:rZ,
  276. Float:rRange,
  277. }
  278. // Removebuilding array
  279. new RemoveData[MAX_REMOVE_BUILDING][REMOVEINFO];
  280. // Object information ENUM
  281. enum OBJECTINFO
  282. {
  283. oID, // Object id
  284. #if defined COMPILE_MANGLE
  285. oCAID, // ColAndreas index
  286. #endif
  287. oGroup, // Object group
  288. oModel, // Object Model
  289. Text3D:oTextID, // Object 3d text label
  290. oNote[64], // Object note
  291. Float:oX, // Position Z
  292. Float:oY, // Position Z
  293. Float:oZ, // Position Z
  294. Float:oRX, // Rotation Z
  295. Float:oRY, // Rotation Z
  296. Float:oRZ, // Rotation Z
  297. oTexIndex[MAX_MATERIALS], // Texture index ref
  298. oColorIndex[MAX_MATERIALS], // Material List
  299. ousetext, // Use text
  300. oFontFace, // Font face reference
  301. oFontSize, // Font size reference
  302. oFontBold, // Font bold
  303. oFontColor, // Font color
  304. oBackColor, // Font back color
  305. oAlignment, // Font alignment
  306. oTextFontSize, // Font text size
  307. oObjectText[MAX_TEXT_LENGTH], // Font text
  308. oAttachedVehicle, // Vehicle object is attached to
  309. Float:oDD // Draw distance
  310. }
  311. // Copy object material / color
  312. enum COPYINFO
  313. {
  314. cTexIndex[MAX_MATERIALS], // Texture index ref
  315. cColorIndex[MAX_MATERIALS], // Material List
  316. cusetext, // Use text
  317. cFontFace, // Font face reference
  318. cFontSize, // Font size reference
  319. cFontBold, // Font bold
  320. cFontColor, // Font color
  321. cBackColor, // Font back color
  322. cAlignment, // Font alignment
  323. cTextFontSize, // Font text size
  324. cObjectText[MAX_TEXT_LENGTH], // Font text
  325. }
  326. enum XYZ { Float:xPos, Float:yPos, Float:zPos }
  327. enum XYZR { Float:xPos, Float:yPos, Float:zPos, Float:rxPos, Float:ryPos, Float:rzPos }
  328. // Copy buffer data
  329. new CopyBuffer[MAX_PLAYERS][COPYINFO];
  330. // Object information array
  331. new ObjectData[MAX_TEXTURE_OBJECTS][OBJECTINFO];
  332. // 3D Text Options
  333. enum TEXTOPTIONS
  334. {
  335. bool:tShowText,
  336. bool:tShowNote,
  337. bool:tShowModel,
  338. bool:tShowGroup,
  339. bool:tShowGrouped,
  340. bool:tAlwaysShowNew
  341. }
  342. new TextOption[TEXTOPTIONS] = {
  343. true, false, false, true, true, false
  344. };
  345. // Map Options
  346. enum MAPOPTIONS
  347. {
  348. mVersion,
  349. mAuthor[MAX_PLAYER_NAME],
  350. mLastEdit,
  351. mSpawn[XYZ],
  352. mInterior,
  353. mVirtualWorld
  354. }
  355. new MapSetting[MAPOPTIONS];
  356. // Sets the current object a player is editing
  357. new CurrObject[MAX_PLAYERS] = { -1, ... };
  358. // In edit object mode
  359. new bool:EditingMode[MAX_PLAYERS];
  360. // Set textdraw open
  361. new bool:TextDrawOpen[MAX_PLAYERS];
  362. // Current players textdraw
  363. new CurrTextDraw[MAX_PLAYERS];
  364. // Pivot object reference
  365. new PivotObject[MAX_PLAYERS];
  366. // Pivot point
  367. new PivotPoint[MAX_PLAYERS][XYZ];
  368. // Turns pivot point on/off
  369. new bool:PivotPointOn[MAX_PLAYERS];
  370. // Save the current editing position
  371. new Float:CurrEditPos[MAX_PLAYERS][6];
  372. // Currmode
  373. #define EDIT_MODE_NONE 0
  374. #define EDIT_MODE_OBJECT 1
  375. #define EDIT_MODE_CP 2
  376. #define EDIT_MODE_SELECTION 3
  377. #define EDIT_MODE_TEXT 4
  378. #define EDIT_MODE_GROUP 5
  379. #define EDIT_MODE_PIVOT 6
  380. #define EDIT_MODE_OBJECTGROUP 7
  381. #define EDIT_MODE_TEXTURING 8
  382. #define EDIT_MODE_LISTSEL 9
  383. #define EDIT_MODE_OSEARCH 10
  384. #define EDIT_MODE_OBM 11
  385. #define EDIT_MODE_VOBJECT 12
  386. #define EDIT_MODE_MODCAR 13
  387. // Textdraw modes
  388. #define TEXTDRAW_NONE 0
  389. #define TEXTDRAW_TEXTEDIT 1
  390. #define TEXTDRAW_MATERIALS 2
  391. #define TEXTDRAW_LISTSEL 3
  392. #define TEXTDRAW_OSEARCH 4
  393. // Set the players editing mode
  394. #define SetEditMode(%0,%1) CurrMode[%0] = %1
  395. // Get the players editing mode
  396. #define GetEditMode(%0) CurrMode[%0]
  397. // Toggle players textdraw open closed
  398. #define ToggleTextDrawOpen(%0,%1) TextDrawOpen[%0] = %1
  399. // Sets Current TD draw index
  400. #define SetCurrTextDraw(%0,%1) CurrTextDraw[%0] = %1
  401. // Gets Current TD draw index
  402. #define GetCurrTextDraw(%0) CurrTextDraw[%0]
  403. // Get the font face of a player object
  404. #define GetObjectUseText(%0) ObjectData[%0][ousetext]
  405. // Get the font face of a player object
  406. #define GetObjectFontFace(%0) ObjectData[%0][oFontFace]
  407. // Get the font size of a player object
  408. #define GetObjectFontSize(%0) ObjectData[%0][oFontSize]
  409. // Get the font bold of a player object
  410. #define GetObjectFontBold(%0) ObjectData[%0][oFontBold]
  411. // Get the font color of a player object
  412. #define GetObjectFontColor(%0) ObjectData[%0][oFontColor]
  413. // Get the back color of a player object
  414. #define GetObjectBackColor(%0) ObjectData[%0][oBackColor]
  415. // Get the alignment of a player object
  416. #define GetObjectAlignment(%0) ObjectData[%0][oAlignment]
  417. // Get the font size of a player object
  418. #define GetObjectTextFontSize(%0) ObjectData[%0][oTextFontSize]
  419. // Get the text of a player object
  420. #define GetObjectObjectText(%0) ObjectData[%0][oObjectText]
  421. // Set use text
  422. #define SetObjectUseText(%0,%1) ObjectData[%0][ousetext] = %1
  423. // Set object object text
  424. #define SetObjectObjectText(%0,%1) format(ObjectData[%0][oObjectText], MAX_TEXT_LENGTH, "%s", %1)
  425. // Set font face
  426. #define SetObjectFontFace(%0,%1) ObjectData[%0][oFontFace] = %1
  427. // Set font size
  428. #define SetObjectFontSize(%0,%1) ObjectData[%0][oFontSize] = %1
  429. // Set font bold
  430. #define SetObjectFontBold(%0,%1) ObjectData[%0][oFontBold] = %1
  431. // Set the alignment of a player object
  432. #define SetObjectAlignment(%0,%1) ObjectData[%0][oAlignment] = %1
  433. // Set the font size of a player object
  434. #define SetObjectTextFontSize(%0,%1) ObjectData[%0][oTextFontSize] = %1
  435. // Set font color
  436. #define SetFontColor(%0,%1) ObjectData[%0][oFontColor] = %1
  437. // Set font color
  438. #define SetBackColor(%0,%1) ObjectData[%0][oBackColor] = %1
  439. // Current mode player is in
  440. new CurrMode[MAX_PLAYERS];
  441. // Iterator for ObjectData
  442. new Iterator:Objects<MAX_TEXTURE_OBJECTS>;
  443. // System database
  444. new DB: SystemDB;
  445. // Database for the edit map
  446. new DB: EditMap;
  447. // Current map name
  448. new MapName[128];
  449. // Theme data
  450. new DB: ThemeDataDB;
  451. // Checks if a map is open
  452. new bool:MapOpen;
  453. // Undo module
  454. #include "tstudio\undo.pwn"
  455. // Webcolor list
  456. #include "tstudio\webcolors.pwn"
  457. // Flymode
  458. #include "tstudio\flymode.pwn"
  459. // Text editor module
  460. #include "tstudio\texteditor.pwn"
  461. // Texture viewer
  462. #include "tstudio\texviewer.pwn"
  463. // ===== Restriction Variables =====
  464. new Iterator:Restriction[MAX_GROUPS]<MAX_PLAYERS>, bool:gRestricted[MAX_GROUPS] = {false, ...};
  465. // playerid, object index (must be 0 or more than 50, if not it must be in a group with no restrictions, if not then the restriction must allow this player)
  466. #define CanSelectObject(%0,%1) \
  467. (!(0 <= %1 < MAX_TEXTURE_OBJECTS) || (!gRestricted[ObjectData[%1][oGroup]] || !(0 < ObjectData[%1][oGroup] < MAX_GROUPS) || !Iter_Count(Restriction[ObjectData[%1][oGroup]]) || Iter_Contains(Restriction[ObjectData[%1][oGroup]], playerid) || IsPlayerAdmin(playerid)))
  468. // playerid, group index (it must be a group with no restrictions, if not then the restriction must allow this player)
  469. #define CanSelectGroup(%0,%1) \
  470. (!(0 < %1 < MAX_GROUPS) || (!gRestricted[%1] || !Iter_Count(Restriction[%1]) || Iter_Contains(Restriction[%1], playerid) || IsPlayerAdmin(playerid)))
  471. //not in this ? then safely test these
  472. // ===== Not a very good modular technique... =====
  473. // Group editing
  474. #include "tstudio\groups.pwn"
  475. // RCON Restrictor
  476. #include "tstudio\restrict.pwn"
  477. // List selection
  478. #include "tstudio\listsel.pwn"
  479. // Object property editor/viewer
  480. #include "tstudio\propeditor.pwn"
  481. // Object search
  482. #include "tstudio\osearch.pwn"
  483. // Objectmetry module
  484. #include "tstudio\objm.pwn"
  485. #include "tstudio\obmedit.pwn"
  486. // GTA objects module
  487. #include "tstudio\gtaobjects.pwn"
  488. // Local input module
  489. #if defined COMPILE_LOCAL_INPUT
  490. #include "tstudio\localinput.pwn"
  491. #endif
  492. // Vehicles
  493. #include "tstudio\vehiclecolors.pwn"
  494. #include "tstudio\vehicles.pwn"
  495. // Special includes
  496. #if defined COMPILE_MANGLE
  497. #include "tstudio\mangle.pwn"
  498. #endif
  499. // Menu GUI
  500. #include "tstudio\menugui.pwn"
  501. // Help Command
  502. #include "tstudio\helpcmd.pwn"
  503. // Main system
  504. #include "tstudio\tsmain.pwn"
  505. // SA-MP Introspect by Slice and Y_Less, automatically included with debug mode.
  506. #if debug > 1
  507. #define AMX_NAME "tstudio.amx"
  508. #include <interpreter>
  509. #include "tstudio\debugging.pwn"
  510. #endif