Animations
#1

Hey.

I have this command. But how do i make a function for this ? I mean the list of animations (array ) ?

Code:
CMD:anims(playerid)
{
	new data[650];
	for(new i = 0; i < sizeof(Anims); i++)
	{
		format(data, sizeof(data), "%s%s\n", data, Anims[i][Command]);
	}
	ShowPlayerDialog(playerid, DIALOG_ANIMS, DIALOG_STYLE_LIST, "Animations:", data,  "Select", "Exit");
	return 1;
}
Reply
#2

PHP Code:
new Anims[][]=
{
 
"Anim 1",
 
"Anim 2",
} 
you meant this huh?
ok
Reply
#3

I hope you get it. For more check: https://sampwiki.blast.hk/wiki/Animations.
There are just 3 examples of animations, you can add more.

PHP Code:
new Anims[ ][ AnimOption ] =
{
    { 
"Wave", "/wave" },
    { 
"Wank", "/wank" },
    { 
"Relax", "/relax" } // etc
};
enum AnimOption
{
    
AnName[ 100 ],
    
Command[ 32 ]
}
public 
OnDialogResponse( playerid, dialogid, response, listitem, inputtext[ ] )
{
    switch( 
dialogid )
    {
        case 
DIALOG_ANIMS:
        {
            if( !
response )
                return 
1;
            switch( 
listitem )
            {
                case 
0: ApplyAnimation( playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0 ); // wave
                
case 1: ApplyAnimation( playerid, "PAULNMAC", "wank_loop", 1.800001, 1, 0, 0, 1, 600 ); // wank
                
case 2: ApplyAnimation( playerid, "BEACH", "bather", 4.0, 1, 0, 0, 0, 0 ); // relax
            
}
        }
        return 
1;
    }
    return 
0;
}
CMD:anims(playerid)
{
    new 
data[ 650 ];
    for( new 
i = 0; i < sizeof( Anims ); i ++ )
    {
        
format( data, sizeof( data ), "%s%s\t %s\n", data, Anims[ i ][ AnName ], Anims[ i ][ Command ] );
    }
    
ShowPlayerDialog( playerid, DIALOG_ANIMS, DIALOG_STYLE_LIST, "Animations:", data,  "Select", "Exit" );
    return 
1;
}
CMD:wave( playerid, params[ ] )
    return 
ApplyAnimation( playerid, "ON_LOOKERS", "wave_loop", 4.0, 1, 0, 0, 0, 0 );
CMD:wank( playerid, params[ ] )
    return 
ApplyAnimation( playerid, "PAULNMAC", "wank_loop", 1.800001, 1, 0, 0, 1, 600 );
CMD:relax( playerid, params[ ] )
    return 
ApplyAnimation( playerid, "BEACH", "bather", 4.0, 1, 0, 0, 0, 0 );
    
CMD:stopanim( playerid, params[ ] )
    return 
ClearAnimations( playerid ); 
EDIT:
- Sorry, i didn't see that someone already replied.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)