IsPlayerSitting - 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: IsPlayerSitting (
/showthread.php?tid=513842)
IsPlayerSitting -
Dziugsas - 18.05.2014
Hello guys tried to make something ,but as you can see i am loser:
Код:
stock IsPlayerSitting(playerid)
{
if(GetPlayerAnimationIndex(playerid))
{
new animlib[32],animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
if(strfind(animlib, "PED", true) && strfind(animname, "SEAT_down", true)) return 1;
}
}
How to return value like true or 1?
Re: IsPlayerSitting -
Pottus - 18.05.2014
You would want something like...
pawn Код:
stock IsPlayerSitting(playerid)
{
switch(GetPlayerAnimationIndex(playerid)) { case 10, 20: return 1; }
return 0;
}
Just set the animation indexes you want to correspond with the switch()
Re: IsPlayerSitting -
Dziugsas - 18.05.2014
And what are '10' and '20'?
pawn Код:
stock IsPlayerSitting(playerid)
{
if(GetPlayerAnimationIndex(playerid))
{
new animlib[32],animname[32];
GetAnimationName(GetPlayerAnimationIndex(playerid),animlib,32,animname,32);
if(strfind(animlib, "PED", true) && strfind(animname, "SEAT_down", true)) return 1;
}
return 0;
}
Is this going to work?