SA-MP Forums Archive
NPC w/ 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: NPC w/ Animation (/showthread.php?tid=326609)



NPC w/ Animation - Ricey - 18.03.2012

Hello SA-MP Users.

I'm Creating my Advanced Gym System.

And Bassically i Want the Boxer Guy (in Red)
To Do the Animation of The Following Code Below
-
Код:
ApplyAnimation(playerid,"GYMNASIUM","GYMshadowbox",4.1,1,1,1,1,9500);
-

Now, I'm Wondering how i go About that,
I Had a Bit of Research but i Found if I Recorded it as the Boxer and Played the Animation the Boxer just Stands There.

Cheers,
Ricey.

PS: Sorry About my Capitals Habbit


Re: NPC w/ Animation - Jonny5 - 18.03.2012

it would depend WHEN you want this to take place,

maybe using the IsPlayerInRangeOfPoint
and if they are then apply the animation at that time.


Re: NPC w/ Animation - Ricey - 18.03.2012

Thankyou for Making no Sense.

But... I Think your on a Tottaly Diffrent Thing, I Want this to NPC's...
Read the Dam Post.

Cheers
Ricey.


Re: NPC w/ Animation - Jonny5 - 19.03.2012

lol, I read the post... and clearly understood what you meant.

if no players are in range of the npc then
no one would see the Animation as it would play WHEN you use ApplyAnimation

so if you use ApplyAnimation WHEN a player is in range then the player would see it.


regards,


Re: NPC w/ Animation - new121 - 19.03.2012

pawn Код:
public onplayerupdate(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerNPC(i)
            {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(i, X, Y, Z);
                if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z))
                {
                   ApplyAnimation(i,"GYMNASIUM","GYMshadowbox",4.1,1,1,1,1,9500);
                }
            }
        }
    }
    return 1;
}



Respuesta: Re: NPC w/ Animation - admantis - 19.03.2012

Quote:
Originally Posted by new121
Посмотреть сообщение
pawn Код:
public onplayerupdate(playerid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerNPC(i)
            {
                new Float:X, Float:Y, Float:Z;
                GetPlayerPos(i, X, Y, Z);
                if(IsPlayerInRangeOfPoint(playerid, 5.0, X, Y, Z))
                {
                   ApplyAnimation(i,"GYMNASIUM","GYMshadowbox",4.1,1,1,1,1,9500);
                }
            }
        }
    }
    return 1;
}
for loop inside onplayerupdate
not bad


Re: Respuesta: Re: NPC w/ Animation - new121 - 19.03.2012

Quote:
Originally Posted by admantis
Посмотреть сообщение
for loop inside onplayerupdate
not bad
Ok??


Re: NPC w/ Animation - Ricey - 20.03.2012

Thanks Alot new121,