Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //-------------------------------- [ Includes ] ------------------------------//
- #include " a_samp "
- #include " zcmd "
- #include " mselection "
- //-------------------------------- [ Defines ] -------------------------------//
- #if !defined Y
- #define Y \
- "{CDAE59}"
- #endif
- #if !defined W
- #define W \
- "{FFFFFF}"
- #endif
- #if !defined SCM
- #define SCM \
- SendClientMessage
- #endif
- #if !defined SPD
- #define SPD \
- ShowPlayerDialog
- #endif
- //---------------------------------- [ News ] --------------------------------//
- new
- attachlist = mS_INVALID_LISTID ,
- AttachmentBones [ ] [ 24 ] =
- {
- { "Spine" } , { "Head" } , { "Left upper arm" } , { "Right upper arm" } ,
- { "Left hand" } , { "Right hand" } , { "Left thigh" } , { "Right thigh" } ,
- { "Left foot" } , { "Right foot" } , { "Right calf" } , { "Left calf" } ,
- { "Left forearm" } , { "Right forearm" } , { "Left clavicle" } , { "Right clavicle" } ,
- { "Neck" } , { "Jaw" }
- }
- ;
- //-------------------------------- [ Commands ] ------------------------------//
- CMD:hold( playerid , params [ ] )
- {
- new
- string [ 512 ]
- ;
- for ( new x ; x < MAX_PLAYER_ATTACHED_OBJECTS ; x++ )
- {
- if ( IsPlayerAttachedObjectSlotUsed ( playerid , x ) )
- {
- format ( string , sizeof ( string ) , "%s "Y"SLOT"W" %d: "Y"USED"W" \n" , string , x ) ;
- }
- else format ( string , sizeof ( string ) , "%s "Y"SLOT"W" %d: "Y"NOT USED"W" \n" , string , x ) ;
- }
- SPD ( playerid , 14 , DIALOG_STYLE_LIST , ""Y"H"W"o"Y"l"W"d" , string , "O.K" , "Cancel" ) ;
- return ( 1 ) ;
- }
- //-------------------------------- [ Publics ] -------------------------------//
- public OnFilterScriptInit ( )
- {
- attachlist = LoadModelSelectionMenu ( "attachments.cfg" ) ;
- return ( 1 ) ;
- }
- public OnFilterScriptExit ( ) return ( 1 ) ;
- public OnPlayerEditAttachedObject ( playerid , response , index , modelid , boneid ,
- Float:fOffsetX , Float:fOffsetY , Float:fOffsetZ , Float:fRotX , Float:fRotY ,
- Float:fRotZ , Float:fScaleX , Float:fScaleY , Float:fScaleZ )
- {
- SetPlayerAttachedObject ( playerid , index , modelid , boneid ,
- fOffsetX , fOffsetY , fOffsetZ , fRotX ,
- fRotY , fRotZ , fScaleX , fScaleY ,
- fScaleZ ) ;
- return ( 1 ) ;
- }
- public OnPlayerModelSelection ( playerid , response , listid , modelid )
- {
- if ( listid == attachlist )
- {
- if ( response )
- {
- if ( GetPVarInt ( playerid , "AttachmentUsed" ) == 1 )
- {
- EditAttachedObject ( playerid , modelid ) ;
- }
- else
- {
- SetPVarInt ( playerid , "AttachmentModelSel" , modelid ) ;
- new
- string [ 656 + 1 ]
- ;
- for ( new x ; x < sizeof ( AttachmentBones ) ; x++ )
- {
- format ( string , sizeof ( string ) , "%s "Y"MODE:"W" %s \n" , string , AttachmentBones [ x ] ) ;
- }
- SPD ( playerid , 16 , DIALOG_STYLE_LIST , ""Y"H"W"o"Y"l"W"d" , string , "O.K" , "Cancel" ) ;
- }
- }
- else DeletePVar ( playerid , "AttachmentIndexSel" ) ;
- return ( 1 ) ;
- }
- return ( 1 ) ;
- }
- public OnDialogResponse ( playerid , dialogid , response , listitem , inputtext [ ] )
- {
- if ( dialogid == 16 )
- {
- if ( response )
- {
- SetPlayerAttachedObject ( playerid , GetPVarInt ( playerid , "AttachmentIndexSel" ) ,
- GetPVarInt ( playerid , "AttachmentModelSel" ) , listitem + 1 ) ;
- EditAttachedObject ( playerid , GetPVarInt ( playerid , "AttachmentIndexSel" ) ) ;
- SCM ( playerid , 0xFFFFFFFF , ""Y"HINT:"W" Use PED_SPRINT to look around." ) ;
- }
- DeletePVar ( playerid , "AttachmentIndexSel" ) ;
- DeletePVar ( playerid , "AttachmentModelSel" ) ;
- return ( 1 ) ;
- }
- if ( dialogid == 14 )
- {
- if ( response )
- {
- if ( IsPlayerAttachedObjectSlotUsed ( playerid , listitem ) )
- {
- 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" ) ;
- }
- else
- {
- for ( new x ; x < sizeof ( attachlist ) ; x++ )
- {
- ShowModelSelectionMenu ( playerid , attachlist , "Attachments" ) ;
- }
- SetPVarInt ( playerid , "AttachmentIndexSel" , listitem ) ;
- }
- }
- }
- if ( dialogid == 15 )
- {
- if ( response )
- {
- for ( new i = 0 ; i < MAX_PLAYER_ATTACHED_OBJECTS ; i++ )
- {
- if ( IsPlayerAttachedObjectSlotUsed ( playerid , i ) ) RemovePlayerAttachedObject ( playerid , i ) ;
- DeletePVar ( playerid , "AttachmentIndexSel" ) ;
- }
- }
- }
- return ( 1 ) ;
- }
- //------------------------------ [ End of file ] -----------------------------//
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement