SA-MP Forums Archive
Anims - 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: Anims (/showthread.php?tid=321087)



Anims - Twinki1993 - 25.02.2012

Well I've got a problem. Only 1 animation is working...

Code:
PHP код:
OnPlayerCommand
    
if(strcmp(cmdtext"/walkdrunk"true) == 0)
    {
        
ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1,1);
    }
    if(
strcmp(cmdtext"/gwalk1"true) == 0)
    {
        
ApplyAnimation(playerid,"PED","WALK_gang1 ",4.1,1,1,1,1,1,1);
    }
    if(
strcmp(cmdtext"/gwalk2"true) == 0)
    {
        
ApplyAnimation(playerid,"PED","WALK_gang2 ",4.1,1,1,1,1,1,1);
    }
    if(
strcmp(cmdtext"/oldwalk"true) == 0)
    {
        
ApplyAnimation(playerid,"PED","WALK_old ",4.1,1,1,1,1,1,1);
    }
    if(
strcmp(cmdtext"/walkarmed"true) == 0)
    {
        
ApplyAnimation(playerid,"PED","WALK_armed ",4.1,1,1,1,1,1,1);
    }
    if(
strcmp(cmdtext"/walkciv"true) == 0)
    {
        
ApplyAnimation(playerid,"PED","WALK_civi ",4.1,1,1,1,1,1,1);
    }
    return 
0;

Only /walkdrunk is working


Re: Anims - GtasaPoliceModz - 25.02.2012

Do Return 1; At the bottom

This
Код:
Return 1;
Not
Код:
Return 0;



Re: Anims - Twinki1993 - 25.02.2012

Did it already. But same thing..


Re: Anims - GtasaPoliceModz - 25.02.2012

Код:
OnPlayerCommand

    if(strcmp(cmdtext, "/walkdrunk", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1,1);
    return 1;
    }
    if(strcmp(cmdtext, "/gwalk1", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_gang1 ",4.1,1,1,1,1,1,1);
    return 1;
    }
    if(strcmp(cmdtext, "/gwalk2", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_gang2 ",4.1,1,1,1,1,1,1);
    return 1;
    }
    if(strcmp(cmdtext, "/oldwalk", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_old ",4.1,1,1,1,1,1,1);
    return 1;
    }
    if(strcmp(cmdtext, "/walkarmed", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_armed ",4.1,1,1,1,1,1,1);
    return 1;
    }
    if(strcmp(cmdtext, "/walkciv", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_civi ",4.1,1,1,1,1,1,1);
    return 1;
    }
    return 0;
}



Re: Anims - Twinki1993 - 25.02.2012

As I said. I did it already. With or without return 1 it's not working at all.


Re: Anims - FalconX - 25.02.2012

Quote:
Originally Posted by GtasaPoliceModz
Посмотреть сообщение
Код:
OnPlayerCommand

    if(strcmp(cmdtext, "/walkdrunk", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1,1);
    return 1;
    }
    if(strcmp(cmdtext, "/gwalk1", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_gang1 ",4.1,1,1,1,1,1,1);
    return 1;
    }
    if(strcmp(cmdtext, "/gwalk2", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_gang2 ",4.1,1,1,1,1,1,1);
    return 1;
    }
    if(strcmp(cmdtext, "/oldwalk", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_old ",4.1,1,1,1,1,1,1);
    return 1;
    }
    if(strcmp(cmdtext, "/walkarmed", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_armed ",4.1,1,1,1,1,1,1);
    return 1;
    }
    if(strcmp(cmdtext, "/walkciv", true) == 0)
    {
    ApplyAnimation(playerid,"PED","WALK_civi ",4.1,1,1,1,1,1,1);
    return 1;
    }
    return 0;
}
If this didn't work, try using the "ClearAnimations(playerid);" in the begining of each command which stops all the animation and start the one which you want.

-FalconX


Re: Anims - Twinki1993 - 25.02.2012

So then I should try with
Quote:

if(strcmp(cmdtext, "/gwalk1", true) == 0)
{
ClearAnimations(playerid);
ApplyAnimation.....

?


Re: Anims - GtasaPoliceModz - 25.02.2012

Yes Example
Код:
if(strcmp(cmdtext, "/walkdrunk", true) == 0)
    {
     ClearAnimations(playerid);    
     ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1,1);
    }



Re: Anims - FalconX - 25.02.2012

Quote:
Originally Posted by Twinki1993
Посмотреть сообщение
So then I should try with

?
Yes mate try that.

pawn Код:
if(strcmp(cmdtext, "/walkdrunk", true) == 0)
{
    ClearAnimations(playerid);
    ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1,1);
    SendClientMessage(playerid, COLOR_RED, "SERVER: You are walking drunk.");
    return 1;
}
Hope that fixes the problem

-FalconX


Re: Anims - Twinki1993 - 25.02.2012

Tested. Not working. Even with this that /walkdrunk is the Only one that's working