#1

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
Reply
#2

Do Return 1; At the bottom

This
Код:
Return 1;
Not
Код:
Return 0;
Reply
#3

Did it already. But same thing..
Reply
#4

Код:
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;
}
Reply
#5

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

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
Reply
#7

So then I should try with
Quote:

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

?
Reply
#8

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

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
Reply
#10

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


Forum Jump:


Users browsing this thread: 1 Guest(s)