SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/01/2018, 07:59 PM   #1
MrCesar
Big Clucker
 
MrCesar's Avatar
 
Join Date: Sep 2016
Location: Under your bed ;)
Posts: 154
Reputation: 1
Default tutorial stuck on stage 2

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;
}
__________________
"The journey of a thousand miles begins with one step." - Lao Tzu
MrCesar is online now   Reply With Quote
Old 13/01/2018, 08:19 PM   #2
Misiur
High-roller
 
Misiur's Avatar
 
Join Date: Jul 2009
Location: Poland
Posts: 2,528
Reputation: 552
Default Re: tutorial stuck on stage 2

Take a look at last parameter in each SetTimerEx and numbers next to your cases.
Misiur is offline   Reply With Quote
Old 13/01/2018, 08:48 PM   #3
MrCesar
Big Clucker
 
MrCesar's Avatar
 
Join Date: Sep 2016
Location: Under your bed ;)
Posts: 154
Reputation: 1
Default Re: tutorial stuck on stage 2

Quote:
Originally Posted by Misiur View Post
Take a look at last parameter in each SetTimerEx and numbers next to your cases.
what do you mean?
__________________
"The journey of a thousand miles begins with one step." - Lao Tzu
MrCesar is online now   Reply With Quote
Old 13/01/2018, 08:57 PM   #4
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Vladivostok
Posts: 3,269
Reputation: 747
Default Re: tutorial stuck on stage 2

EDIT: you don't have `case 3:`
__________________
Find me on GitHub SEF Community (Official NEF Successor) SALobby Community SA:MP Reviews Find me on Steam
Kaperstone is offline   Reply With Quote
Old 13/01/2018, 09:45 PM   #5
MrCesar
Big Clucker
 
MrCesar's Avatar
 
Join Date: Sep 2016
Location: Under your bed ;)
Posts: 154
Reputation: 1
Default Re: tutorial stuck on stage 2

Quote:
Originally Posted by Kaperstone View Post
EDIT: you don't have `case 3:`
rofl my bad, any tip about how i can make it for unregistered players only?

edit: after fixing the script it just spawns me at some weird place with my body cut in a half no matter how i define the spawn pos..any idea what's causing that?
__________________
"The journey of a thousand miles begins with one step." - Lao Tzu
MrCesar is online now   Reply With Quote
Old 13/01/2018, 10:51 PM   #6
Lucases
Huge Clucker
 
Join Date: Jul 2017
Posts: 225
Reputation: 8
Default Re: tutorial stuck on stage 2

You don't set spawn Info before spawning
Lucases is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Map] Stage map DemCaribous Maps 7 18/12/2013 08:35 AM
[Map] Stage MAP James2292 Maps 2 12/08/2013 10:02 AM
Tutorial bugs [stuck] Stanford Scripting Help 9 08/02/2013 06:27 AM
Stuck in tutorial Stanford Scripting Help 1 01/02/2013 03:07 PM


All times are GMT. The time now is 12:40 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.