Problem forbid animation
#1

I created this code to prohibit an animation, how can I do so that it detects the animation ? tried using "strcmp" but did not work.

Код:
 
if(GetPlayerAnimationIndex(playerid))
{
      new animlib[32], animname[32];
      if(GetAnimationName(GetPlayerAnimationIndex(playerid), animlib, 32, animname, 32))
      {
            if(animlib == "CARRY" || animname == "crry_prtial")
            {
                  SendClientMessage(playerid, -1, "Animation prohibited on the server !");
                  Kick(playerid);
            }
      }
}
Someone for help-me
Reply
#2

strcmp does work. It returns 0 when both strings are equal so that would be:
pawn Код:
if (!strcmp(animlib, "CARRY") && !strcmp(animname, "crry_prtial"))
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
strcmp does work. It returns 0 when both strings are equal so that would be:
pawn Код:
if (!strcmp(animlib, "CARRY") && !strcmp(animname, "crry_prtial"))
When I did not put in strcmp false! "strcmp", so it did not work.

Problem solved!

Thank! + rep
Reply
#4

if(strcmp(animlib, "CARRY") && strcmp(animname, "crry_prtial"))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)