Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

tutorial stuck on stage 2

$
0
0
hello guys, i am trying to script a roleplay based tutorial, and my tutorial stops after the second message is sent, and also it appears even after i register, how do I make it to appear for not registered players? Here's the code:

Code:

forward SkipSpawn(playerid);
public OnPlayerRequestClass(playerid)
{
    TogglePlayerSpectating(playerid, true);
          SetTimerEx("SkipSpawn",1,0,"i",playerid);
          return 1;
}
public SkipSpawn(playerid)
{
    TogglePlayerControllable(playerid, 0);
        SetTimerEx("OnPlayerInTutorial",5000,0,"ii",playerid,1);
          return 1;
}
forward OnPlayerInTutorial(playerid,step);
public OnPlayerInTutorial(playerid,step)
{
    switch(step)
    {
        case 1:
        {
            //2nd message
            SendClientMessage(playerid,-1,"here the text 1");
            SetTimerEx("OnPlayerInTutorial",5000,0,"ii",playerid,2);
            return 1;
        }
        case 2:
        {
            //3rd message
            SendClientMessage(playerid,-1,"here the text 2");
            SetTimerEx("OnPlayerInTutorial",5000,0,"ii",playerid,3);
            return 1;
        }
        case 4:
        {
            //4th message
            SendClientMessage(playerid,-1,"here the text 3");
            SetTimerEx("OnPlayerInTutorial",5000,0,"ii",playerid,4);
            return 1;
        }
        case 5:
        {
            //last tutorial step
            SendClientMessage(playerid,-1,"here the text 4");
            SetTimerEx("OnPlayerInTutorial",5000,0,"ii",playerid,5);
            return 1;
        }
        case 6:
        {
            SendClientMessage(playerid,-1,"fin");
                        TogglePlayerControllable(playerid, 1);
            SpawnPlayer(playerid);
            return 1;
        }
    }
    return 1;
}


Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>