SA-MP Forums Archive
2 little bugs in OnPlayerRequestClass - 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: 2 little bugs in OnPlayerRequestClass (/showthread.php?tid=445056)



2 little bugs in OnPlayerRequestClass - mickos - 19.06.2013

Hey hello,

I have a little problem, the problem is in OnPlayerRequestClass. I've added music and anims in the OnPlayerRequestClass. But the anim is only showing by the first character. And not by the rest by the characters. And the music is repeating again and again when I look by another skins. But the music must be play during the time in OnPlayerRequestClass... And not repeating when I choose another skin.

This is it:

pawn Код:
public OnPlayerRequestClass(playerid, classid)
{
    PlayAudioStreamForPlayer(playerid, "http://somafm.com/tags.pls");
    SetPlayerInterior(playerid,5);
    SetPlayerPos(playerid,762.6628,11.2875,1001.1639);
    SetPlayerFacingAngle(playerid, 270);
    SetPlayerCameraPos(playerid,767.6994,11.1984,1000.7057);
    SetPlayerCameraLookAt(playerid,762.6628,11.2875,1001.1639);
    switch (classid)
    {
        case 0:
        {
            for(new count;count <288;count++)
            {
            GameTextForPlayer(playerid,"~r~Welcome",800,6);
            }
            ApplyAnimation(playerid,"FIGHT_D","FightD_3",4.1,1,1,1,1,1,1);
        }
    }
    return 1;
}



Re: 2 little bugs in OnPlayerRequestClass - MP2 - 19.06.2013

Look at your switch statement.


Re: 2 little bugs in OnPlayerRequestClass - mickos - 19.06.2013

My co-owner told me thats the switch statement good is, and nothing wrong with it is.. Hmm


Re: 2 little bugs in OnPlayerRequestClass - MP2 - 19.06.2013

case 0 - when the class is 0, apply the animation. It's pretty obvious if you look at it LOGICALLY.


Re: 2 little bugs in OnPlayerRequestClass - mickos - 19.06.2013

Okay, but how can I make a fast way to set the classes 0 to 288 in the case? just likes:

Quote:

(new count;count <288;count++)




Re: 2 little bugs in OnPlayerRequestClass - MP2 - 19.06.2013

What are you talking about? Just move the ApplyAnimation line outside of the switch statement.


Re: 2 little bugs in OnPlayerRequestClass - mickos - 20.06.2013

Its already fixed, I am sorry for my late reaction. My co-owner was confused and told me the fake-truth =P