LucasForums

LucasForums (http://www.lucasforums.com/index.php)
-   JA Coding (http://www.lucasforums.com/forumdisplay.php?f=539)
-   -   What is bad here ? (http://www.lucasforums.com/showthread.php?t=179911)

lukluk 06-26-2007 04:43 PM

What is bad here ?
 
Code:

void Svcmd_taunt_f (void)
{
        if ( trap_Argc() < 2 ) {
                anim = BOTH_GESTURE1;
                return;
        }
}

I have 1 error in this code :
1.error C2065: 'anim' : undeclared identifier

Please help me !

DarthDie 06-26-2007 05:44 PM

You never made "anim" anything...its supposed to be a int:
Code:

void Svcmd_taunt_f(void)
{
if (trap_Argc() < 2)
{
int anim = BOTH_GESTURE1;
return;
}
}

Also this will not set the players anim....I dont have the function name off the top of my head that will....

lukluk 07-11-2007 06:34 PM

lol why player dont use animation when i type /taunt2 in console with using this code
Code:

void Svcmd_taunt2_f(void)
{
if (trap_Argc() < 2)
{
int anim = BOTH_GESTURE1;
return;
}
}


Griswald 07-11-2007 09:27 PM

you shouldn't even need the "int anim" part, but you do need to pass on the entity to the function you created. The function for animating (I believe) is G_SetAnim:

G_SetAnim(ent, &ent->client->pers.cmd, SETANIM_BOTH, BOTH_GESTURE1, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD, 0);

However, there is also PM_SetAnim and BG_SetAnim (an NPC_SetAnim exists, but thats for npcs of course). If someone else could clarify when each instance are best used, I'm sure the Original poster would be more educated as well as the rest of us =)

ensiform 07-13-2007 03:33 PM

You're also not calling that function when the player had typed /taunt2 anyway. :| *cough* ClientCommand *cough*


All times are GMT -4. The time now is 12:01 AM.

Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
LFNetwork, LLC ©2002-2011 - All rights reserved.