Guest User

Untitled

a guest
Jan 1st, 2011
1,215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 55.99 KB | None | 0 0
  1. /*******************************************************************************
  2.                
  3.         Player attached object editor (rewritten from the remains of
  4.                     the old holding object editor).
  5.                         ~ a creation of bren. ~
  6.  
  7. *******************************************************************************/
  8.  
  9. #include                <a_samp>
  10. #include                <foreach>
  11. #include                <zcmd>
  12.  
  13. #define                 COLOR_WHITE                                     0xFFFFFFFF
  14. #define                 COLOR_LIME                                      0xB9FF2BFF
  15. #define                 COLOR_GREY                                      0xCECECEFF
  16. #define                 COLOR_NICERED                                   0xFF5F47FF
  17.  
  18. #define                 SAVED_OBJECT_FILE                               "attachments.txt"
  19. #define                 IsKeyJustDown(%0)                               ((newkeys & %0) && !(oldkeys & %0))
  20.  
  21. #define                 lol_arbitary_number                             (9001) // In case your gamemode runs dialogs and you cbf changing like me
  22.  
  23. #define                 DIALOG_START                                    (1 + lol_arbitary_number)
  24. #define                 DIALOG_OBJECT                                   (2 + lol_arbitary_number)
  25. #define                 DIALOG_BONE                                     (3 + lol_arbitary_number)      
  26. #define                 DIALOG_EDIT                                     (4 + lol_arbitary_number)  
  27. #define                 DIALOG_DELETE                                   (5 + lol_arbitary_number)      
  28.  
  29. #define                 offsetX                                         (0)
  30. #define                 offsetY                                         (1)
  31. #define                 offsetZ                                         (2)
  32. #define                 rotationX                                       (3)
  33. #define                 rotationY                                       (4)
  34. #define                 rotationZ                                       (5)
  35. #define                 scaleX                                          (6)
  36. #define                 scaleY                                          (7)
  37. #define                 scaleZ                                          (8)
  38.  
  39. enum objEnum {
  40.     objID,
  41.     objBone,
  42. }
  43.  
  44. enum editorEnum {
  45.     editingIndex,
  46.     editingStat,
  47.     Text: editingText,
  48. }
  49.  
  50. new stock
  51.     objVars[MAX_PLAYERS][MAX_PLAYER_ATTACHED_OBJECTS][objEnum],
  52.     Float: objFloats[MAX_PLAYERS][MAX_PLAYER_ATTACHED_OBJECTS][9],
  53.     editorVars[MAX_PLAYERS][editorEnum];
  54.  
  55. stock resetSlot(playerid, index) {
  56.     if(IsPlayerAttachedObjectSlotUsed(playerid, index)) RemovePlayerAttachedObject(playerid, index);
  57.     objVars[playerid][index][objID] = -1;
  58.     objVars[playerid][index][objBone] = 0;
  59.     objFloats[playerid][index][offsetX] = 0.0;
  60.     objFloats[playerid][index][offsetY] = 0.0;
  61.     objFloats[playerid][index][offsetZ] = 0.0;
  62.     objFloats[playerid][index][rotationX] = 0.0;
  63.     objFloats[playerid][index][rotationY] = 0.0;
  64.     objFloats[playerid][index][rotationZ] = 0.0;
  65.     objFloats[playerid][index][scaleX] = 1.0;
  66.     objFloats[playerid][index][scaleY] = 1.0;
  67.     objFloats[playerid][index][scaleZ] = 1.0;
  68.     return 1;
  69. }
  70.  
  71. stock updateAttachedObject(playerid, index) {
  72.    
  73.     new
  74.         sz_textStr[128];
  75.    
  76.     switch(editorVars[playerid][editingStat]) {
  77.         case 0: switch(objVars[playerid][index][objBone]) {
  78.             case 1: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Spine", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  79.             case 2: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Head", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  80.             case 3: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left upper arm", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  81.             case 4: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right upper arm", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  82.             case 5: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left hand", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  83.             case 6: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right hand", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  84.             case 7: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left thigh", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  85.             case 8: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right thigh", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  86.             case 9: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left foot", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  87.             case 10: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right foot", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  88.             case 11: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right calf", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  89.             case 12: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left calf", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  90.             case 13: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left forearm", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  91.             case 14: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right forearm", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  92.             case 15: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left clavicle", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  93.             case 16: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right clavicle", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  94.             case 17: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Neck", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  95.             case 18: format(sz_textStr, sizeof(sz_textStr), "X OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Jaw", objFloats[playerid][index][offsetX], index, objVars[playerid][index][objID]);
  96.             // default: format(sz_textStr, sizeof(sz_textStr), "EVERYTHING FUCKING BLOW UP NOW IT'S BONE ZERO!111");
  97.         }
  98.         case 1: switch(objVars[playerid][index][objBone]) {
  99.             case 1: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Spine", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  100.             case 2: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Head", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  101.             case 3: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left upper arm", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  102.             case 4: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right upper arm", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  103.             case 5: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left hand", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  104.             case 6: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right hand", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  105.             case 7: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left thigh", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  106.             case 8: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right thigh", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  107.             case 9: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left foot", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  108.             case 10: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right foot", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  109.             case 11: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right calf", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  110.             case 12: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left calf", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  111.             case 13: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left forearm", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  112.             case 14: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right forearm", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  113.             case 15: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left clavicle", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  114.             case 16: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right clavicle", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  115.             case 17: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Neck", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  116.             case 18: format(sz_textStr, sizeof(sz_textStr), "Y OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Jaw", objFloats[playerid][index][offsetY], index, objVars[playerid][index][objID]);
  117.             // default: format(sz_textStr, sizeof(sz_textStr), "EVERYTHING FUCKING BLOW UP NOW IT'S BONE ZERO!111");
  118.         }
  119.         case 2: switch(objVars[playerid][index][objBone]) {
  120.             case 1: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Spine", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  121.             case 2: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Head", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  122.             case 3: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left upper arm", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  123.             case 4: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right upper arm", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  124.             case 5: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left hand", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  125.             case 6: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right hand", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  126.             case 7: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left thigh", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  127.             case 8: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right thigh", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  128.             case 9: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left foot", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  129.             case 10: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right foot", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  130.             case 11: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right calf", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  131.             case 12: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left calf", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  132.             case 13: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left forearm", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  133.             case 14: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right forearm", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  134.             case 15: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left clavicle", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  135.             case 16: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right clavicle", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  136.             case 17: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Neck", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  137.             case 18: format(sz_textStr, sizeof(sz_textStr), "Z OFFSET~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Jaw", objFloats[playerid][index][offsetZ], index, objVars[playerid][index][objID]);
  138.             // default: format(sz_textStr, sizeof(sz_textStr), "EVERYTHING FUCKING BLOW UP NOW IT'S BONE ZERO!111");
  139.         }  
  140.         case 3: switch(objVars[playerid][index][objBone]) {
  141.             case 1: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Spine", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  142.             case 2: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Head", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  143.             case 3: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left upper arm", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  144.             case 4: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right upper arm", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  145.             case 5: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left hand", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  146.             case 6: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right hand", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  147.             case 7: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left thigh", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  148.             case 8: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right thigh", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  149.             case 9: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left foot", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  150.             case 10: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right foot", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  151.             case 11: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right calf", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  152.             case 12: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left calf", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  153.             case 13: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left forearm", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  154.             case 14: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right forearm", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  155.             case 15: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left clavicle", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  156.             case 16: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right clavicle", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  157.             case 17: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Neck", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  158.             case 18: format(sz_textStr, sizeof(sz_textStr), "X ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Jaw", objFloats[playerid][index][rotationX], index, objVars[playerid][index][objID]);
  159.             // default: format(sz_textStr, sizeof(sz_textStr), "EVERYTHING FUCKING BLOW UP NOW IT'S BONE ZERO!111");
  160.         }  
  161.         case 4: switch(objVars[playerid][index][objBone]) {
  162.             case 1: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Spine", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  163.             case 2: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Head", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  164.             case 3: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left upper arm", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  165.             case 4: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right upper arm", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  166.             case 5: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left hand", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  167.             case 6: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right hand", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  168.             case 7: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left thigh", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  169.             case 8: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right thigh", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  170.             case 9: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left foot", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  171.             case 10: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right foot", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  172.             case 11: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right calf", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  173.             case 12: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left calf", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  174.             case 13: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left forearm", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  175.             case 14: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right forearm", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  176.             case 15: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left clavicle", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  177.             case 16: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right clavicle", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  178.             case 17: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Neck", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  179.             case 18: format(sz_textStr, sizeof(sz_textStr), "Y ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Jaw", objFloats[playerid][index][rotationY], index, objVars[playerid][index][objID]);
  180.             // default: format(sz_textStr, sizeof(sz_textStr), "EVERYTHING FUCKING BLOW UP NOW IT'S BONE ZERO!111");
  181.         }  
  182.         case 5: switch(objVars[playerid][index][objBone]) {
  183.             case 1: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Spine", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  184.             case 2: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Head", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  185.             case 3: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left upper arm", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  186.             case 4: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right upper arm", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  187.             case 5: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left hand", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  188.             case 6: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right hand", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  189.             case 7: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left thigh", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  190.             case 8: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right thigh", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  191.             case 9: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left foot", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  192.             case 10: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right foot", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  193.             case 11: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right calf", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  194.             case 12: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left calf", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  195.             case 13: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left forearm", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  196.             case 14: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right forearm", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  197.             case 15: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left clavicle", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  198.             case 16: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right clavicle", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  199.             case 17: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Neck", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  200.             case 18: format(sz_textStr, sizeof(sz_textStr), "Z ROTATION~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Jaw", objFloats[playerid][index][rotationZ], index, objVars[playerid][index][objID]);
  201.             // default: format(sz_textStr, sizeof(sz_textStr), "EVERYTHING FUCKING BLOW UP NOW IT'S BONE ZERO!111");
  202.         }  
  203.         case 6: switch(objVars[playerid][index][objBone]) {
  204.             case 1: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Spine", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  205.             case 2: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Head", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  206.             case 3: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left upper arm", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  207.             case 4: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right upper arm", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  208.             case 5: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left hand", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  209.             case 6: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right hand", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  210.             case 7: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left thigh", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  211.             case 8: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right thigh", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  212.             case 9: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left foot", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  213.             case 10: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right foot", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  214.             case 11: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right calf", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  215.             case 12: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left calf", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  216.             case 13: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left forearm", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  217.             case 14: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right forearm", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  218.             case 15: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left clavicle", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  219.             case 16: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right clavicle", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  220.             case 17: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Neck", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  221.             case 18: format(sz_textStr, sizeof(sz_textStr), "X SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Jaw", objFloats[playerid][index][scaleX], index, objVars[playerid][index][objID]);
  222.             // default: format(sz_textStr, sizeof(sz_textStr), "EVERYTHING FUCKING BLOW UP NOW IT'S BONE ZERO!111");
  223.         }  
  224.         case 7: switch(objVars[playerid][index][objBone]) {
  225.             case 1: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Spine", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  226.             case 2: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Head", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  227.             case 3: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left upper arm", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  228.             case 4: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right upper arm", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  229.             case 5: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left hand", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  230.             case 6: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right hand", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  231.             case 7: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left thigh", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  232.             case 8: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right thigh", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  233.             case 9: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left foot", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  234.             case 10: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right foot", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  235.             case 11: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right calf", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  236.             case 12: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left calf", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  237.             case 13: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left forearm", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  238.             case 14: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right forearm", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  239.             case 15: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left clavicle", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  240.             case 16: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right clavicle", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  241.             case 17: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Neck", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  242.             case 18: format(sz_textStr, sizeof(sz_textStr), "Y SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Jaw", objFloats[playerid][index][scaleY], index, objVars[playerid][index][objID]);
  243.             // default: format(sz_textStr, sizeof(sz_textStr), "EVERYTHING FUCKING BLOW UP NOW IT'S BONE ZERO!111");
  244.         }  
  245.         case 8: switch(objVars[playerid][index][objBone]) {
  246.             case 1: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Spine", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  247.             case 2: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Head", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  248.             case 3: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left upper arm", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  249.             case 4: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right upper arm", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  250.             case 5: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left hand", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  251.             case 6: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right hand", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  252.             case 7: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left thigh", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  253.             case 8: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right thigh", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  254.             case 9: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left foot", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  255.             case 10: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right foot", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  256.             case 11: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right calf", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  257.             case 12: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left calf", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  258.             case 13: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left forearm", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  259.             case 14: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right forearm", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  260.             case 15: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Left clavicle", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  261.             case 16: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Right clavicle", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  262.             case 17: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Neck", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  263.             case 18: format(sz_textStr, sizeof(sz_textStr), "Z SCALE~n~~r~%f~w~~n~~n~INDEX: ~r~%i~w~~n~~n~OBJECT: ~r~%i~w~~n~~n~BONE:~r~ Jaw", objFloats[playerid][index][scaleZ], index, objVars[playerid][index][objID]);
  264.             // default: format(sz_textStr, sizeof(sz_textStr), "EVERYTHING FUCKING BLOW UP NOW IT'S BONE ZERO!111");
  265.         }  
  266.     }
  267.     TextDrawSetString(editorVars[playerid][editingText], sz_textStr);
  268.     return SetPlayerAttachedObject(playerid, index, objVars[playerid][index][objID], objVars[playerid][index][objBone], objFloats[playerid][index][offsetX], objFloats[playerid][index][offsetY], objFloats[playerid][index][offsetZ], objFloats[playerid][index][rotationX], objFloats[playerid][index][rotationY], objFloats[playerid][index][rotationZ], objFloats[playerid][index][scaleX], objFloats[playerid][index][scaleY], objFloats[playerid][index][scaleZ]);
  269. }
  270.  
  271. public OnPlayerUpdate(playerid) {
  272.     if(editorVars[playerid][editingStat] >= 0) {
  273.         new
  274.             i_Keys[3];
  275.            
  276.         GetPlayerKeys(playerid, i_Keys[0], i_Keys[1], i_Keys[2]);
  277.        
  278.         if(i_Keys[1] < 0) {
  279.             if(i_Keys[0] & KEY_SPRINT) objFloats[playerid][editorVars[playerid][editingIndex]][editorVars[playerid][editingStat]] += 1.0;
  280.             else if(i_Keys[0] & KEY_SECONDARY_ATTACK) objFloats[playerid][editorVars[playerid][editingIndex]][editorVars[playerid][editingStat]] += 0.01;
  281.             else if(i_Keys[0] == 0) objFloats[playerid][editorVars[playerid][editingIndex]][editorVars[playerid][editingStat]] += 0.1;
  282.             updateAttachedObject(playerid, editorVars[playerid][editingIndex]);
  283.         }
  284.         else if(i_Keys[1] > 0) {
  285.             if(i_Keys[0] & KEY_SPRINT) objFloats[playerid][editorVars[playerid][editingIndex]][editorVars[playerid][editingStat]] -= 1.0;
  286.             else if(i_Keys[0] & KEY_SECONDARY_ATTACK) objFloats[playerid][editorVars[playerid][editingIndex]][editorVars[playerid][editingStat]] -= 0.01;
  287.             else if(i_Keys[0] == 0) objFloats[playerid][editorVars[playerid][editingIndex]][editorVars[playerid][editingStat]] -= 0.1;
  288.             updateAttachedObject(playerid, editorVars[playerid][editingIndex]);
  289.         }
  290.         else if(i_Keys[2] > 0) {
  291.             switch(editorVars[playerid][editingStat]) {
  292.                 case 0 .. 7: editorVars[playerid][editingStat]++;
  293.                 default: editorVars[playerid][editingStat] = 0;
  294.             }
  295.             updateAttachedObject(playerid, editorVars[playerid][editingIndex]);
  296.         }
  297.         else if(i_Keys[2] < 0) {
  298.             switch(editorVars[playerid][editingStat]) {
  299.                 case 1 .. 8: editorVars[playerid][editingStat]--;
  300.                 default: editorVars[playerid][editingStat] = 8;
  301.             }
  302.             updateAttachedObject(playerid, editorVars[playerid][editingIndex]);
  303.         }
  304.     }
  305.     return 1;
  306. }
  307.  
  308. public OnPlayerSpawn(playerid) {
  309.     return SendClientMessage(playerid, COLOR_WHITE, "Use {B9FF2B}/editor{FFFFFF} to begin.");
  310. }
  311.  
  312. public OnFilterScriptInit() {
  313.     return print("[Attachment Editor] Loaded.\r\n~ a creation of bren. ~");
  314. }
  315.  
  316. public OnFilterScriptExit() {
  317.     print("[Attachment Editor] Unloaded - removing all existing objects...");
  318.    
  319.     #if !defined foreach
  320.         #define foreach(Player,%0) for(new %0; %0 < MAX_PLAYERS; %0++) if(IsPlayerConnected(%0))
  321.     #endif
  322.    
  323.     foreach(Player, x) {
  324.         for(new a; a < MAX_PLAYER_ATTACHED_OBJECTS; a++) if(objVars[x][a][objID] >= 0) {
  325.             resetSlot(x, a);
  326.         }
  327.     }
  328.     return print("[Attachment Editor] Complete!");
  329. }
  330.  
  331. public OnPlayerConnect(playerid) {
  332.    
  333.     editorVars[playerid][editingText] = TextDrawCreate(622.000000, 298.000000, "X OFFSET~n~200.0~n~~n~INDEX: 5~n~~n~OBJECT: 1337~n~~n~BONE: Head");
  334.     TextDrawAlignment(editorVars[playerid][editingText], 3);
  335.     TextDrawFont(editorVars[playerid][editingText], 1);
  336.     TextDrawLetterSize(editorVars[playerid][editingText], 0.390000, 1.600000);
  337.     TextDrawColor(editorVars[playerid][editingText], -1);
  338.     TextDrawSetOutline(editorVars[playerid][editingText], 1);
  339.     TextDrawSetProportional(editorVars[playerid][editingText], 1);
  340.    
  341.     editorVars[playerid][editingIndex] = -1;
  342.     editorVars[playerid][editingStat] = -1;
  343.    
  344.     for(new x; x < MAX_PLAYER_ATTACHED_OBJECTS; x++) {
  345.         resetSlot(playerid, x);
  346.     }
  347.     return 1;
  348. }
  349.  
  350. public OnPlayerDisconnect(playerid, reason) {
  351.     editorVars[playerid][editingStat] = -1;
  352.     return TextDrawDestroy(editorVars[playerid][editingText]);
  353. }
  354.  
  355. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) {
  356.     switch(dialogid) {
  357.         case DIALOG_START: {
  358.             if(response) switch(listitem) {
  359.                 case 0: {
  360.                
  361.                     new
  362.                         i_Iter;
  363.                        
  364.                     while(i_Iter < MAX_PLAYER_ATTACHED_OBJECTS) {
  365.                         if(!IsPlayerAttachedObjectSlotUsed(playerid, i_Iter)) {
  366.                             editorVars[playerid][editingIndex] = i_Iter;
  367.                             return ShowPlayerDialog(playerid, DIALOG_OBJECT, DIALOG_STYLE_INPUT, "{B9FF2B}EDITOR:{FFFFFF} Object", "Specify an object ID you wish to attach.", "Select", "Return");
  368.                         }
  369.                         i_Iter++;
  370.                     }
  371.                     SendClientMessage(playerid, COLOR_WHITE, "All available object slots are in use - delete one first.");
  372.                     ShowPlayerDialog(playerid, DIALOG_START, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Start", "Add New Object\r\nEdit Existing Object\r\nRemove Object", "Select", "Return");
  373.                 }  
  374.                 case 1: {
  375.                    
  376.                     new
  377.                         sz_dialogStr[256], // Needs $$$$$$$$$$$$ size $$$$$$$$$$$
  378.                         i_Iter;
  379.                        
  380.                     while(i_Iter < MAX_PLAYER_ATTACHED_OBJECTS) {
  381.                         if(objVars[playerid][i_Iter][objID] == -1) {
  382.                             if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index %i: {FF5F47}Unused{FFFFFF}", i_Iter);
  383.                             else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex %i: {FF5F47}Unused{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  384.                         }
  385.                         else {
  386.                             if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", i_Iter, objVars[playerid][i_Iter][objID]);
  387.                             else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  388.                         }
  389.                         ++i_Iter;
  390.                     }
  391.                     ShowPlayerDialog(playerid, DIALOG_EDIT, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Edit Existing Object", sz_dialogStr, "Select", "Return");
  392.                 }
  393.                 case 2: {
  394.                     new
  395.                         sz_dialogStr[256],
  396.                         i_Iter;
  397.                        
  398.                     while(i_Iter < MAX_PLAYER_ATTACHED_OBJECTS) {
  399.                         if(objVars[playerid][i_Iter][objID] == -1) {
  400.                             if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index %i: {FF5F47}Unused{FFFFFF}", i_Iter);
  401.                             else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex %i: {FF5F47}Unused{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  402.                         }
  403.                         else {
  404.                             if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", i_Iter, objVars[playerid][i_Iter][objID]);
  405.                             else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  406.                         }
  407.                         ++i_Iter;
  408.                     }
  409.                     ShowPlayerDialog(playerid, DIALOG_DELETE, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Delete Object", sz_dialogStr, "Select", "Return");               
  410.                 }
  411.             }
  412.         }
  413.         case DIALOG_EDIT: {
  414.             if(response) {
  415.                 if(objVars[playerid][listitem][objID] == -1) {
  416.                     SendClientMessage(playerid, COLOR_GREY, "This index is not in use; therefore, it can not be edited.");
  417.                    
  418.                     new
  419.                         sz_dialogStr[256],
  420.                         i_Iter;
  421.                        
  422.                     while(i_Iter < MAX_PLAYER_ATTACHED_OBJECTS) {
  423.                         if(objVars[playerid][i_Iter][objID] == -1) {
  424.                             if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index %i: {FF5F47}Unused{FFFFFF}", i_Iter);
  425.                             else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex %i: {FF5F47}Unused{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  426.                         }
  427.                         else {
  428.                             if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", i_Iter, objVars[playerid][i_Iter][objID]);
  429.                             else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  430.                         }
  431.                         ++i_Iter;
  432.                     }
  433.                     ShowPlayerDialog(playerid, DIALOG_EDIT, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Edit Existing Object", sz_dialogStr, "Select", "Return");
  434.                 }
  435.                 else {
  436.                     editorVars[playerid][editingIndex] = listitem;
  437.                     editorVars[playerid][editingStat] = 0;
  438.                    
  439.                     updateAttachedObject(playerid, editorVars[playerid][editingIndex]);
  440.                     TogglePlayerControllable(playerid, false);
  441.                    
  442.                     TextDrawShowForPlayer(playerid, editorVars[playerid][editingText]);
  443.                     SendClientMessage(playerid, COLOR_WHITE, "Use the {B9FF2B}up{FFFFFF} and {B9FF2B}down{FFFFFF} keys to move the object. Press {B9FF2B}jump{FFFFFF} to return to the menu.");
  444.                     SendClientMessage(playerid, COLOR_WHITE, "The current editing axis may be changed at any time with the {B9FF2B}left{FFFFFF} or {B9FF2B}right{FFFFFF} keys.");
  445.                     SendClientMessage(playerid, COLOR_WHITE, "Use {B9FF2B}sprint{FFFFFF} for a speed boost, or {B9FF2B}enter{FFFFFF} for accuracy, {B9FF2B}/saveattachments{FFFFFF} to save.");            
  446.                 }
  447.             }
  448.             else ShowPlayerDialog(playerid, DIALOG_START, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Start", "Add New Object\r\nEdit Existing Object\r\nRemove Object", "Select", "Return");
  449.         }
  450.         case DIALOG_DELETE: {
  451.             if(response) {
  452.                 if(objVars[playerid][listitem][objID] == -1) {
  453.                     SendClientMessage(playerid, COLOR_GREY, "This index is not in use; therefore, it can not be deleted.");
  454.                    
  455.                     new
  456.                         sz_dialogStr[256],
  457.                         i_Iter;
  458.                        
  459.                     while(i_Iter < MAX_PLAYER_ATTACHED_OBJECTS) {
  460.                         if(objVars[playerid][i_Iter][objID] == -1) {
  461.                             if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index %i: {FF5F47}Unused{FFFFFF}", i_Iter);
  462.                             else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex %i: {FF5F47}Unused{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  463.                         }
  464.                         else {
  465.                             if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", i_Iter, objVars[playerid][i_Iter][objID]);
  466.                             else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  467.                         }
  468.                         ++i_Iter;
  469.                     }
  470.                     ShowPlayerDialog(playerid, DIALOG_DELETE, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Delete Object", sz_dialogStr, "Select", "Return");
  471.                 }
  472.                 else {
  473.                     SendClientMessage(playerid, COLOR_WHITE, "You have successfully {B9FF2B}deleted{FFFFFF} this object.");
  474.                     resetSlot(playerid, listitem);
  475.                    
  476.                     new
  477.                         sz_dialogStr[256],
  478.                         i_Iter;
  479.                        
  480.                     while(i_Iter < MAX_PLAYER_ATTACHED_OBJECTS) {
  481.                         if(objVars[playerid][i_Iter][objID] == -1) {
  482.                             if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index %i: {FF5F47}Unused{FFFFFF}", i_Iter);
  483.                             else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex %i: {FF5F47}Unused{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  484.                         }
  485.                         else {
  486.                             if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", i_Iter, objVars[playerid][i_Iter][objID]);
  487.                             else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  488.                         }
  489.                         ++i_Iter;
  490.                     }
  491.                     ShowPlayerDialog(playerid, DIALOG_DELETE, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Delete Object", sz_dialogStr, "Select", "Return");
  492.                 }
  493.             }
  494.             else ShowPlayerDialog(playerid, DIALOG_START, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Start", "Add New Object\r\nEdit Existing Object\r\nRemove Object", "Select", "Return");
  495.         }
  496.         case DIALOG_OBJECT: {
  497.             if(response) switch(strval(inputtext)) {
  498.                 case 321 .. 3399: {
  499.                     objVars[playerid][editorVars[playerid][editingIndex]][objID] = strval(inputtext);
  500.                     ShowPlayerDialog(playerid, DIALOG_BONE, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Bone", "Spine\r\nHead\r\nLeft upper arm\r\nRight upper arm\r\nLeft hand\r\nRight hand\r\nLeft thigh\r\nRight thigh\r\nLeft foot\r\nRight foot\r\nRight calf\r\nLeft calf\r\nLeft forearm\r\nRight forearm\r\nLeft clavicle\r\nRight clavicle\r\nNeck\r\nJaw", "Select", "Return");
  501.                 }
  502.                 default: ShowPlayerDialog(playerid, DIALOG_OBJECT, DIALOG_STYLE_INPUT, "{B9FF2B}EDITOR:{FFFFFF} Object", "Invalid object specified.\n\nSpecify an object ID you wish to attach.", "Select", "Return");
  503.             }
  504.             else {
  505.                 ShowPlayerDialog(playerid, DIALOG_START, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Start", "Add New Object\r\nEdit Existing Object\r\nRemove Object", "Select", "Return");
  506.                 editorVars[playerid][editingIndex] = -1;
  507.             }
  508.         }
  509.         case DIALOG_BONE: {
  510.             if(response) {
  511.                 editorVars[playerid][editingStat] = 0;
  512.                 objVars[playerid][editorVars[playerid][editingIndex]][objBone] = listitem + 1;
  513.                
  514.                 updateAttachedObject(playerid, editorVars[playerid][editingIndex]);
  515.                 TogglePlayerControllable(playerid, false);
  516.                
  517.                 TextDrawShowForPlayer(playerid, editorVars[playerid][editingText]);
  518.                 SendClientMessage(playerid, COLOR_WHITE, "Use the {B9FF2B}up{FFFFFF} and {B9FF2B}down{FFFFFF} keys to move the object. Press {B9FF2B}jump{FFFFFF} to return to the menu.");
  519.                 SendClientMessage(playerid, COLOR_WHITE, "The current editing axis may be changed at any time with the {B9FF2B}left{FFFFFF} or {B9FF2B}right{FFFFFF} keys.");
  520.                 SendClientMessage(playerid, COLOR_WHITE, "Use {B9FF2B}sprint{FFFFFF} for a speed boost, or {B9FF2B}enter{FFFFFF} for accuracy, {B9FF2B}/saveattachments{FFFFFF} to save.");
  521.             }
  522.             else ShowPlayerDialog(playerid, DIALOG_OBJECT, DIALOG_STYLE_INPUT, "{B9FF2B}EDITOR:{FFFFFF} Object", "Specify an object ID you wish to attach.", "Select", "Return");
  523.         }
  524.     }
  525.     return 1;
  526. }
  527.  
  528. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) {
  529.     if(IsKeyJustDown(KEY_JUMP) && editorVars[playerid][editingIndex] >= 0) {
  530.        
  531.         TextDrawHideForPlayer(playerid, editorVars[playerid][editingText]);
  532.         editorVars[playerid][editingIndex] = -1;
  533.         editorVars[playerid][editingStat] = -1;
  534.        
  535.         new
  536.             sz_dialogStr[256], // Needs $$$$$$$$$$$$ size $$$$$$$$$$$
  537.             i_Iter;
  538.            
  539.         while(i_Iter < MAX_PLAYER_ATTACHED_OBJECTS) {
  540.             if(objVars[playerid][i_Iter][objID] == -1) {
  541.                 if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index %i: {FF5F47}Unused{FFFFFF}", i_Iter);
  542.                 else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex %i: {FF5F47}Unused{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  543.             }
  544.             else {
  545.                 if(!i_Iter) format(sz_dialogStr, sizeof(sz_dialogStr), "Index {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", i_Iter, objVars[playerid][i_Iter][objID]);
  546.                 else format(sz_dialogStr, sizeof(sz_dialogStr), "%s\r\nIndex {B9FF2B}%i{FFFFFF}: Object ID {B9FF2B}%i{FFFFFF}", sz_dialogStr, i_Iter, objVars[playerid][i_Iter][objID]);
  547.             }
  548.             ++i_Iter;
  549.         }
  550.         ShowPlayerDialog(playerid, DIALOG_EDIT, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Edit Existing Object", sz_dialogStr, "Select", "Return");
  551.         TogglePlayerControllable(playerid, true);
  552.     }
  553.     return 1;
  554. }
  555.  
  556. CMD:editor(playerid, params[]) {
  557.     switch(editorVars[playerid][editingIndex]) {
  558.         case -1: ShowPlayerDialog(playerid, DIALOG_START, DIALOG_STYLE_LIST, "{B9FF2B}EDITOR:{FFFFFF} Start", "Add New Object\r\nEdit Existing Object\r\nRemove Object", "Select", "Return");
  559.         default: {
  560.             TogglePlayerControllable(playerid, true);
  561.             TextDrawHideForPlayer(playerid, editorVars[playerid][editingText]);
  562.             editorVars[playerid][editingIndex] = -1;
  563.             editorVars[playerid][editingStat] = -1;    
  564.         }
  565.     }
  566.     return 1;
  567. }
  568.  
  569. CMD:saveattachments(playerid, params[]) {
  570.    
  571.     new
  572.         i_Iter;
  573.        
  574.     while(i_Iter < MAX_PLAYER_ATTACHED_OBJECTS) {
  575.         if(IsPlayerAttachedObjectSlotUsed(playerid, i_Iter)) break;
  576.         ++i_Iter;
  577.     }
  578.     if(i_Iter == MAX_PLAYER_ATTACHED_OBJECTS) {
  579.         return SendClientMessage(playerid, COLOR_GREY, "You have no attached objects to save.");
  580.     }
  581.     i_Iter = 0;
  582.        
  583.     while(params[i_Iter] > 0) {
  584.         if(params[i_Iter] == '\\') {
  585.             return SendClientMessage(playerid, COLOR_GREY, "Escape characters ({B9FF2B}'\\'{CECECE}) may not be used in comments.");
  586.         }
  587.         ++i_Iter;
  588.     }
  589.  
  590.     new
  591.         arr_TimeStamper[2][3],
  592.         File: i_objFile,
  593.         sz_Formatted[256];
  594.        
  595.     i_objFile = fopen(SAVED_OBJECT_FILE, io_append);
  596.    
  597.     getdate(arr_TimeStamper[0][0], arr_TimeStamper[0][1], arr_TimeStamper[0][2]);
  598.     gettime(arr_TimeStamper[1][0], arr_TimeStamper[1][1], arr_TimeStamper[1][2]);
  599.  
  600.     format(sz_Formatted, sizeof(sz_Formatted), "SESSION DATE (%i/%i/%i) TIME (%i:%i.%i) COMMENT:", arr_TimeStamper[0][2], arr_TimeStamper[0][1], arr_TimeStamper[0][0], arr_TimeStamper[1][0], arr_TimeStamper[1][1], arr_TimeStamper[1][2]);
  601.     fwrite(i_objFile, sz_Formatted);
  602.     fwrite(i_objFile, params);
  603.     fwrite(i_objFile, "\r\n");
  604.    
  605.     for(new x; x < MAX_PLAYER_ATTACHED_OBJECTS; x++) if(IsPlayerAttachedObjectSlotUsed(playerid, x)) {
  606.         format(sz_Formatted, sizeof(sz_Formatted), "SetPlayerAttachedObject(playerid, %i, %i, %i, %f, %f, %f, %f, %f, %f, %f, %f, %f);\r\n", x, objVars[playerid][x][objID], objVars[playerid][x][objBone], objFloats[playerid][x][offsetX], objFloats[playerid][x][offsetY], objFloats[playerid][x][offsetZ], objFloats[playerid][x][rotationX], objFloats[playerid][x][rotationY], objFloats[playerid][x][rotationZ], objFloats[playerid][x][scaleX], objFloats[playerid][x][scaleY], objFloats[playerid][x][scaleZ]);
  607.         fwrite(i_objFile, sz_Formatted);
  608.     }
  609.    
  610.     fclose(i_objFile);
  611.     SendClientMessage(playerid, COLOR_WHITE, "All attached objects have been saved to {B9FF2B}'attachments.txt'{FFFFFF}, inside your {B9FF2B}/scriptfiles/{FFFFFF} directory.");
  612.     return 1;
  613. }
Advertisement
Add Comment
Please, Sign In to add comment