Advertisement
Darky

O.T [Hold Studio][0.3x]

Apr 11th, 2013
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 5.45 KB | None | 0 0
  1. //-------------------------------- [ Includes ] ------------------------------//
  2. #include                                                      "     a_samp     "
  3. #include                                                      "      zcmd      "
  4. #include                                                      "    mselection  "
  5. //-------------------------------- [ Defines ] -------------------------------//
  6. #if !defined Y
  7. #define Y \
  8.     "{CDAE59}"
  9. #endif
  10. #if !defined W
  11. #define W \
  12.     "{FFFFFF}"
  13. #endif
  14. #if !defined SCM
  15. #define SCM \
  16.     SendClientMessage
  17. #endif
  18. #if !defined SPD
  19. #define SPD \
  20.     ShowPlayerDialog
  21. #endif
  22. //---------------------------------- [ News ] --------------------------------//
  23. new
  24.     attachlist    =   mS_INVALID_LISTID ,
  25.     AttachmentBones   [   ]  [   24   ] =
  26.     {
  27.         { "Spine"        } , { "Head"          } , { "Left upper arm" } , { "Right upper arm" } ,
  28.         { "Left hand"    } , { "Right hand"    } , { "Left thigh"     } , { "Right thigh"     } ,
  29.         { "Left foot"    } , { "Right foot"    } , { "Right calf"     } , { "Left calf"       } ,
  30.         { "Left forearm" } , { "Right forearm" } , { "Left clavicle"  } , { "Right clavicle"  } ,
  31.         { "Neck"         } , { "Jaw"           }
  32.     }
  33. ;
  34. //-------------------------------- [ Commands ] ------------------------------//
  35. CMD:hold(   playerid   ,   params   [   ]   )
  36. {
  37.     new
  38.         string [   512   ]
  39.     ;
  40.     for   (   new x ;   x   <   MAX_PLAYER_ATTACHED_OBJECTS ;   x++   )
  41.     {
  42.         if   (   IsPlayerAttachedObjectSlotUsed   (   playerid   ,   x   )   )
  43.         {
  44.             format   (   string   ,   sizeof   (   string   )   ,   "%s "Y"SLOT"W" %d: "Y"USED"W" \n"   ,   string   ,   x   ) ;
  45.         }
  46.         else format   (   string   ,   sizeof   (   string   )   , "%s "Y"SLOT"W" %d: "Y"NOT USED"W" \n"   ,   string   ,   x   ) ;
  47.     }
  48.     SPD   (   playerid   ,   14   ,   DIALOG_STYLE_LIST   ,   ""Y"H"W"o"Y"l"W"d"   ,   string   ,   "O.K"   ,   "Cancel"   ) ;
  49.     return ( 1 ) ;
  50. }
  51. //-------------------------------- [ Publics ] -------------------------------//
  52. public OnFilterScriptInit   (   )
  53. {
  54.     attachlist  =   LoadModelSelectionMenu  (   "attachments.cfg"   ) ;
  55.     return ( 1 ) ;
  56. }
  57. public OnFilterScriptExit   (   )   return ( 1 ) ;
  58. public OnPlayerEditAttachedObject   (   playerid    ,   response     ,  index         , modelid     ,   boneid    ,
  59.                                      Float:fOffsetX , Float:fOffsetY , Float:fOffsetZ , Float:fRotX , Float:fRotY ,
  60.                                      Float:fRotZ    , Float:fScaleX  , Float:fScaleY  , Float:fScaleZ             )
  61. {
  62.     SetPlayerAttachedObject   (   playerid   ,  index    ,   modelid   ,   boneid   ,
  63.                                   fOffsetX   ,  fOffsetY ,   fOffsetZ  ,   fRotX    ,
  64.                                   fRotY      ,  fRotZ    ,   fScaleX   ,   fScaleY  ,
  65.                                   fScaleZ                                           ) ;
  66.     return ( 1 ) ;
  67. }
  68. public OnPlayerModelSelection   (   playerid    ,   response    ,   listid  ,   modelid )
  69. {
  70.     if  (   listid  ==  attachlist  )
  71.     {
  72.         if  (   response    )
  73.         {
  74.             if  (   GetPVarInt  (   playerid    ,   "AttachmentUsed"    )   ==  1   )
  75.             {
  76.  
  77.                 EditAttachedObject  (   playerid    ,   modelid   ) ;
  78.             }
  79.             else
  80.             {
  81.                 SetPVarInt  (   playerid    ,   "AttachmentModelSel"    ,   modelid   ) ;
  82.                 new
  83.                     string [   656 + 1   ]
  84.  
  85.                 ;
  86.                 for   (   new x ;   x   <   sizeof   (   AttachmentBones   ) ;   x++   )
  87.                 {
  88.                     format  (   string   ,  sizeof  (   string  )   ,   "%s "Y"MODE:"W" %s \n"  ,   string  ,   AttachmentBones   [   x   ]   ) ;
  89.                 }
  90.                 SPD   (   playerid   ,  16  ,   DIALOG_STYLE_LIST   ,   ""Y"H"W"o"Y"l"W"d"  ,   string   ,   "O.K"   ,   "Cancel"   ) ;
  91.             }
  92.         }
  93.         else DeletePVar   (   playerid   ,   "AttachmentIndexSel"   ) ;
  94.         return ( 1 ) ;
  95.     }
  96.     return ( 1 ) ;
  97. }
  98. public OnDialogResponse   (   playerid   ,   dialogid   ,   response   ,   listitem   ,   inputtext   [   ]   )
  99. {
  100.     if  (   dialogid    ==  16  )
  101.     {
  102.         if  (   response    )
  103.         {
  104.             SetPlayerAttachedObject   (   playerid   ,   GetPVarInt   (   playerid   ,   "AttachmentIndexSel"   ) ,
  105.                 GetPVarInt   (   playerid   ,   "AttachmentModelSel"   )   ,   listitem   +   1   ) ;
  106.             EditAttachedObject   (   playerid   ,   GetPVarInt   (   playerid   ,   "AttachmentIndexSel"   )   ) ;
  107.             SCM   (   playerid   ,   0xFFFFFFFF   ,   ""Y"HINT:"W" Use PED_SPRINT to look around."   ) ;
  108.         }
  109.         DeletePVar   (   playerid   ,   "AttachmentIndexSel"   ) ;
  110.         DeletePVar   (   playerid   ,   "AttachmentModelSel"   ) ;
  111.         return ( 1 ) ;
  112.     }
  113.     if  (   dialogid    ==  14  )
  114.     {
  115.         if  (   response    )
  116.         {
  117.             if   (   IsPlayerAttachedObjectSlotUsed   (   playerid   ,   listitem   )   )
  118.             {
  119.                 SPD   (   playerid   ,   15   ,   DIALOG_STYLE_MSGBOX   ,   ""Y"H"W"o"Y"l"W"d"   ,   ""W"This slot isn't "Y"available"W".Press on "Y"delete"W" to delete all attachments."   ,   "Delete"   ,   "Close"   ) ;
  120.             }
  121.             else
  122.             {
  123.                 for   (   new x ;   x   <   sizeof   (   attachlist   ) ;   x++   )
  124.                 {
  125.                     ShowModelSelectionMenu   (   playerid   ,   attachlist   ,   "Attachments"   ) ;
  126.                 }
  127.                 SetPVarInt   (   playerid   ,   "AttachmentIndexSel"   ,   listitem   ) ;
  128.             }
  129.         }
  130.     }
  131.     if  (   dialogid    ==  15  )
  132.     {
  133.         if  (   response    )
  134.         {
  135.             for   (   new i   =   0 ;   i   <   MAX_PLAYER_ATTACHED_OBJECTS ;   i++   )
  136.             {
  137.                 if   (   IsPlayerAttachedObjectSlotUsed   (   playerid   ,   i   )   )   RemovePlayerAttachedObject   (   playerid   ,   i   ) ;
  138.                 DeletePVar   (   playerid   ,   "AttachmentIndexSel"   ) ;
  139.             }
  140.         }
  141.     }
  142.     return ( 1 ) ;
  143. }
  144. //------------------------------ [ End of file ] -----------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement