PDA

View Full Version : tutorial stuck on stage 2


MrCesar
13/01/2018, 06:59 PM
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:


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;
}

Misiur
13/01/2018, 07:19 PM
Take a look at last parameter in each SetTimerEx and numbers next to your cases.

MrCesar
13/01/2018, 07:48 PM
Take a look at last parameter in each SetTimerEx and numbers next to your cases.

what do you mean?

Kaperstone
13/01/2018, 07:57 PM
EDIT: you don't have `case 3:`

MrCesar
13/01/2018, 08:45 PM
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?

Lucases
13/01/2018, 09:51 PM
You don't set spawn Info before spawning