SA-MP Forums Archive
All animations in an enum - 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: All animations in an enum (/showthread.php?tid=172649)



All animations in an enum - Slice - 30.08.2010

Using numbers for animations all over your code just ends up getting confusing, using the names would just be better.

Include here. The definitions are animlib_animname.


Re: All animations in an enum - DiddyBop - 30.08.2010

uhm.. isnt that a little out of hand o.O


Re: All animations in an enum - Slice - 31.08.2010

What do you mean?

I'd prefer
pawn Код:
if ( animation == PED_WEAPON_CROUCH ) ..
over
pawn Код:
if ( animation == 1274 ) ..



Re: All animations in an enum - LarzI - 31.08.2010

Really useful, great effort!


Re: All animations in an enum - Grim_ - 31.08.2010

Jeez how long did that take you?!


Re: All animations in an enum - LarzI - 31.08.2010

Probably not too long.. It's mostly C&P from the wiki, I guess, so approx 2-3 hours.


Re: All animations in an enum - Slice - 31.08.2010

Quote:
Originally Posted by Grim_
Посмотреть сообщение
Jeez how long did that take you?!
About 2 minutes.

pawn Код:
new szAnimLib[ 32 ], szAnimName[ 32 ];

print( "enum" );
print( "{" );

for ( new i = 0; i <= 1811; i++ )
{
    GetAnimationName( i, szAnimLib, sizeof( szAnimLib ), szAnimName, sizeof( szAnimName ) );
   
    printf( "%s_%s, // %d", szAnimLib, szAnimName, i );
}

print( "}" );



Re: All animations in an enum - playbox12 - 02.11.2010

Quote:
Originally Posted by g_aSlice
Посмотреть сообщение
About 2 minutes.

pawn Код:
new szAnimLib[ 32 ], szAnimName[ 32 ];

print( "enum" );
print( "{" );

for ( new i = 0; i <= 1811; i++ )
{
    GetAnimationName( i, szAnimLib, sizeof( szAnimLib ), szAnimName, sizeof( szAnimName ) );
   
    printf( "%s_%s, // %d", szAnimLib, szAnimName, i );
}

print( "}" );
That made me laugh, I didn't even think of that. I love the way your scripts are; very effective, short(mostly) and just amazing.

If I had to make this I'd probaly was copy and pasting from the wiki, I never even thought about your method lol.


Re: All animations in an enum - Miguel - 02.11.2010

Quote:
Originally Posted by g_aSlice
Посмотреть сообщение
About 2 minutes.

pawn Код:
new szAnimLib[ 32 ], szAnimName[ 32 ];

print( "enum" );
print( "{" );

for ( new i = 0; i <= 1811; i++ )
{
    GetAnimationName( i, szAnimLib, sizeof( szAnimLib ), szAnimName, sizeof( szAnimName ) );
   
    printf( "%s_%s, // %d", szAnimLib, szAnimName, i );
}

print( "}" );
Marry me!

Seriously, I have never worked with animations, but that was one of the smartest codes I have ever seen. Add indentation!


Re: All animations in an enum - Slice - 02.11.2010

Quote:
Originally Posted by Miguel
Посмотреть сообщение
Marry me!

Seriously, I have never worked with animations, but that was one of the smartest codes I have ever seen. Add indentation!
I'll marry you only if I get to keep my last name!
Thanks, btw.