anim's not working, only id 0 spectating?
#1

Nobody will do the animation when this get's called.. and only id 0 will be spectating
Hope someone can help me

pawn Код:
EndTheGame(WinID)
{
    PlaySoundForAll(1183);
    if(WinID == team1)
    {
        GameTextForAll("~b~team1 win the game!",5000, 5);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(gTeam[i] == team1)
                {
                ApplyAnimation(i, "DANCING", "dance_loop", 4.0, 1, 0, 0, 0, 0);
                }
                else if(gTeam[i] == team2)
                {
                ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
                }
            }
        }
    }

    else if(WinID == team2)
    {
        GameTextForAll("~r~team 2 win the game!",5000, 5);
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
            if(IsPlayerConnected(i))
            {
                if(gTeam[i] == team2)
                {
                ApplyAnimation(i, "DANCING", "dance_loop", 4.0, 1, 0, 0, 0, 0);
                }
                else if(gTeam[i] == team1)
                {
                ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
                }
            }
        }
    }
    SetTimer("Spectate",10000, false);
}
pawn Код:
public Spectate()
{
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            TogglePlayerSpectating(i, true);
                        }
                }
         }
}
Reply
#2

pawn Код:
public Spectate()
{
for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            TogglePlayerSpectating(i, true);
                        }
                }
return 1;
         }

Your SetTimer will work just 10sec after that action, though. Since it's 10000. You had to wait 10sec.
Reply
#3

Thanks allot, Do you know the mistake of the animation to?
Reply
#4

Anims bug sometimes... Put them in the script 2 times, works with me
Reply
#5

Ok, i also discovered that the spectating still only works for id 0 :S
Reply
#6

https://sampwiki.blast.hk/wiki/PlayerSpectatePlayer
would also need to be used?

and for the animations, first set player controllable to false, and then it should work better
https://sampwiki.blast.hk/wiki/TogglePlayerControllable

who do you want the players to spectate?
Reply
#7

They should spectate nobody. Just look at the river xD
Reply
#8

then use SetPlayerCameraPos and SetPlayerCameraLookat
Reply
#9

Yes but when you have nobody to spectate it will just simply look at the bridge.
Reply
#10

oh yes I see what you want
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)