[HELP] /tutorial
#1

I want to make command when player type /tutorial then he needs to watch tutorial by SetPlayerCameraPos, I need only 3 positions showing, but I f**** something with timers...can you help giving me some script?
Reply
#2

Well, not sure about your camera position but here's what you can do:
pawn Код:
new pTutorial[MAX_PLAYERS]; // This is a global variable used to identify the player steps in tutorial
new pTutorialTimer[MAX_PLAYERS];

CMD:tutorial(playerid, params[])
{
    if(pTutorial[playerid] > 0)
        return SendClientMessage(playerid, -1, "You already started a tutorial.");
       
    pTutorial[playerid] = 1;
    //Here you set the first camera position coordinates and where to look at, etc etc
    SendClientMessage(playerid, -1, "You started the tutorial.");
    pTutorialTimer[playerid] = SetTimerEx("Tutorial", 10000, true, "i", playerid);
    return 1;
}
forward Tutorial(playerid);
public Tutorial(playerid)
{
    if(pTutorial[playerid] == 1)
    {
        pTutorial[playerid] ++;
        //Here you set again the camera whereever you want.
        SendClientMessage(playerid, -1, "The second step in your tutorial.");
    }
    else if(pTutorial[playerid] == 2)
    {
        pTutorial[playerid] ++;
        //Here you set the third camera position and look at
        SendClientMessage(playerid, -1, "The thirt step in your tutorial.");
    }
    else if(pTutorial[playerid] == 3)
    {
        pTutorial[playerid] ++;
        //Here you can set the last camera position and look at
        SendClientMessage(playerid, -1, "This is the final step in your tutorial. Congratulations.");
    }
    else KillTimer(pTutorialTimer[playerid]);
    return 1;
}
And don't forget the next things:
pawn Код:
public OnPlayerConnect(playerid)
{
         pTutorial[playerid] = 0;
         pTutorialTimer[playerid] = 0;
}
public OnPlayerDisconnect(playerid, reason)
{
         KillTimer(pTutorialTimer[playerid]);
}
Reply
#3

Ok I'll try it, Im sleepy right now, tomorrow I'll post here the results
Reply
#4

All is working good, until player spawn...when tut finish the player wont spawn...camera is staying where she is...after all 4 position of tutorialing I puted this:

pawn Код:
//here goes all previous tutorial positions
  }
  else if(pTutorial[playerid] == 5)
  {
     TogglePlayerControllable(playerid, 1);
     OnPlayerSpawn(playerid);
  }
  else KillTimer(pTutorialTimer[playerid]);
  return 1;
Reply
#5

Try this :
pawn Код:
}
  else if(pTutorial[playerid] == 5)
  {
     TogglePlayerControllable(playerid, 1);
     SetCameraBehindPlayer(playerid);//setting cam behind player as normal

     //Or you can do it OnPlayerSpawn(playerid) also
     OnPlayerSpawn(playerid);
  }
Reply
#6

Quote:
Originally Posted by Shabi RoxX
Посмотреть сообщение
Try this :
pawn Код:
}
  else if(pTutorial[playerid] == 5)
  {
     TogglePlayerControllable(playerid, 1);
     SetCameraBehindPlayer(playerid);//setting cam behind player as normal

     //Or you can do it OnPlayerSpawn(playerid) also
     OnPlayerSpawn(playerid);
  }
the same thing....ITs not problem with camera behind player...I put that function at OnPlayerSpawn public, the problem is camera is just staying where she is and player also.....it wont spawn....even I called OnPlayerSpawn at the end of TuT..

I know you was thinking...that the player spawns but camera is not set behind player...its not that problem!
Reply
#7

You are using SetPlayerPos() on player spawn
Reply
#8

aaa I fixed...the problem was when Tut point 4 finish it cant go on 5 cuz I didnt put pTutorial[playerid] ++; on 4 tut..

Thanx both of you .. +Rep !!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)