PDA

View Full Version : All animations in an enum


Slice
30/08/2010, 11:10 PM
Using numbers for animations all over your code just ends up getting confusing, using the names would just be better.

Include here (http://spelsajten.net/animation_names.inc). The definitions are animlib_animname.

DiddyBop
30/08/2010, 11:12 PM
uhm.. isnt that a little out of hand o.O

Slice
31/08/2010, 08:24 AM
What do you mean?

I'd prefer
if ( animation == PED_WEAPON_CROUCH ) ..
over
if ( animation == 1274 ) ..

LarzI
31/08/2010, 10:19 AM
Really useful, great effort!

Grim_
31/08/2010, 10:23 AM
Jeez how long did that take you?!

LarzI
31/08/2010, 10:29 AM
Probably not too long.. It's mostly C&P from the wiki, I guess, so approx 2-3 hours. :p

Grim_
31/08/2010, 10:57 AM
That's still a long time =P

Slice
31/08/2010, 05:54 PM
Jeez how long did that take you?!
About 2 minutes. :D

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( "}" );

MrDeath537
27/09/2010, 10:34 PM
Very nice! So, Is it more faster than GetAnimationName?

Seven.
28/09/2010, 08:08 AM
Very nice!

Slice
30/09/2010, 08:58 AM
Very nice! So, Is it more faster than GetAnimationName?
The speed is the same since it's turned into numbers when you compile it. It's just to help keep things organized!

playbox12
02/11/2010, 05:01 PM
About 2 minutes. :D

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.

Hiddos
02/11/2010, 05:03 PM
Hehe, good job, even though I don't do a damn with animations :D.

How about placing this in the Useful Snippets topic as well ^^?

Miguel
02/11/2010, 05:07 PM
About 2 minutes. :D

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!

Slice
02/11/2010, 05:25 PM
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.

=SR=Tony
25/01/2011, 01:42 PM
Slice i have porblem


C:\Documents and Settings\Stels\Desktop\Server\gamemodes\anims.pwn( 1823) : error 013: no entry point (no public functions)
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase


1 Error.

Slice
25/01/2011, 03:14 PM
This is just an include. You're meant to use it along with other scriptfiles.

euRo
14/07/2011, 11:41 PM
hw to use this :/

N0FeaR
03/01/2012, 02:54 PM
nice post with all anim