Problem forbid animation - 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: Problem forbid animation (
/showthread.php?tid=606035)
Problem forbid animation -
ClaudineiCDS - 28.04.2016
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
Re: Problem forbid animation -
Konstantinos - 28.04.2016
strcmp does work. It returns 0 when both strings are equal so that would be:
pawn Код:
if (!strcmp(animlib, "CARRY") && !strcmp(animname, "crry_prtial"))
Re: Problem forbid animation -
ClaudineiCDS - 29.04.2016
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
Re: Problem forbid animation -
itsCody - 29.04.2016
if(strcmp(animlib, "CARRY") && strcmp(animname, "crry_prtial"))