SA-MP Forums Archive
Animations - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Animations (/showthread.php?tid=653626)



Animations - Hunud - 08.05.2018

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;
}



Re: Animations - CrystalGamer - 08.05.2018

PHP Code:
new Anims[][]=
{
 
"Anim 1",
 
"Anim 2",

you meant this huh?
ok


Re: Animations - FaLLenGirL - 08.05.2018

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
{
    
AnName100 ],
    
Command32 ]
}
public 
OnDialogResponseplayeriddialogidresponselistiteminputtext[ ] )
{
    switch( 
dialogid )
    {
        case 
DIALOG_ANIMS:
        {
            if( !
response )
                return 
1;
            switch( 
listitem )
            {
                case 
0ApplyAnimationplayerid"ON_LOOKERS""wave_loop"4.01000); // wave
                
case 1ApplyAnimationplayerid"PAULNMAC""wank_loop"1.8000011001600 ); // wank
                
case 2ApplyAnimationplayerid"BEACH""bather"4.01000); // relax
            
}
        }
        return 
1;
    }
    return 
0;
}
CMD:anims(playerid)
{
    new 
data650 ];
    for( new 
0sizeofAnims ); ++ )
    {
        
formatdatasizeofdata ), "%s%s\t %s\n"dataAnims][ AnName ], Anims][ Command ] );
    }
    
ShowPlayerDialogplayeridDIALOG_ANIMSDIALOG_STYLE_LIST"Animations:"data,  "Select""Exit" );
    return 
1;
}
CMD:waveplayeridparams[ ] )
    return 
ApplyAnimationplayerid"ON_LOOKERS""wave_loop"4.01000);
CMD:wankplayeridparams[ ] )
    return 
ApplyAnimationplayerid"PAULNMAC""wank_loop"1.8000011001600 );
CMD:relaxplayeridparams[ ] )
    return 
ApplyAnimationplayerid"BEACH""bather"4.01000);
    
CMD:stopanimplayeridparams[ ] )
    return 
ClearAnimationsplayerid ); 
EDIT:
- Sorry, i didn't see that someone already replied.