IsPlayerSitting
#1

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

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()
Reply
#3

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


Forum Jump:


Users browsing this thread: 1 Guest(s)