tutorial scripting
#1

Hello guys, I want to script a tutorial, (rp style) for my server, what do i need to do it?
and is there any tutorial explaining what functions I need to use? thanks in advance
Reply
#2

Hello.

How do you want to structure your tutorial? In a dialog or with a text in the chat?
Should the tutorial go on automatically with a timer or should the player press a button in the dialog to go on?
Reply
#3

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello.

How do you want to structure your tutorial? In a dialog or with a text in the chat?
Should the tutorial go on automatically with a timer or should the player press a button in the dialog to go on?
Hey, I want it with a timer, and in a text message, just setting the camera on some views, and making sendclientmessages, but how do i force spawn the player when the tutorial finishes etc?
thanks
Reply
#4

OK.

You can do it like this:
PHP код:
//when the tutorial starts:
//1st message
SendClientMessage(playerid,-1,"here the text");
SetTimerEx("OnPlayerInTutorial",10000,0,"ii",playerid,1);
//the callback for the timer:
forward OnPlayerInTutorial(playerid,step);
public 
OnPlayerInTutorial(playerid,step)
{
    switch(
step)
    {
        case 
1:
        {
            
//2nd message
            
SendClientMessage(playerid,-1,"here the text");
            
SetTimerEx("OnPlayerInTutorial",10000,0,"ii",playerid,2);
            return 
1;
        }
        case 
2:
        {
            
//3rd message
            
SendClientMessage(playerid,-1,"here the text");
            
SetTimerEx("OnPlayerInTutorial",10000,0,"ii",playerid,3);
            return 
1;
        }
        case 
4:
        {
            
//4th message
            
SendClientMessage(playerid,-1,"here the text");
            
SetTimerEx("OnPlayerInTutorial",10000,0,"ii",playerid,5);
            return 
1;
        }
        case 
5:
        {
            
//last tutorial step
            
SendClientMessage(playerid,-1,"here the text");
            
SetTimerEx("OnPlayerInTutorial",10000,0,"ii",playerid,5);
            return 
1;
        }
        case 
6:
        {
            
SendClientMessage(playerid,-1,"You're tutorial is finish.");
            
SpawnPlayer(playerid);
            return 
1;
        }
    }
    return 
1;

You can take SetPlayerCameraPos (+SetPlayerCameraLookAt) or InterpolateCameraPos (+InterpolateCameraLookAt).

SetPlayerCameraPos + SetPlayerCameraLookAt => the camera is on a fix point and show to a fix point
InterpolateCameraPos + InterpolateCameraLookAt => the camera move (you can fix the seconds how long the camera should move)

More information you can get in sa-mp wiki.
Reply
#5

thanks alot!

EDIT: I am getting some kind of weird api-ms-win-crt-runtime error after i downloaded and included the streamer plugin, what's that?
Reply
#6

Quote:
Originally Posted by MrCesar
Посмотреть сообщение
thanks alot!

EDIT: I am getting some kind of weird api-ms-win-crt-runtime error after i downloaded and included the streamer plugin, what's that?
You need the runtimes, in particular the 2015 ones are what the streamer needs.

https://sampforum.blast.hk/showthread.php?tid=606849
Reply
#7

Quote:
Originally Posted by Mencent
Посмотреть сообщение
OK.

You can do it like this:
PHP код:
//when the tutorial starts:
//1st message
SendClientMessage(playerid,-1,"here the text");
SetTimerEx("OnPlayerInTutorial",10000,0,"ii",playerid,1);
//the callback for the timer:
forward OnPlayerInTutorial(playerid,step);
public 
OnPlayerInTutorial(playerid,step)
{
    switch(
step)
    {
        case 
1:
        {
            
//2nd message
            
SendClientMessage(playerid,-1,"here the text");
            
SetTimerEx("OnPlayerInTutorial",10000,0,"ii",playerid,2);
            return 
1;
        }
        case 
2:
        {
            
//3rd message
            
SendClientMessage(playerid,-1,"here the text");
            
SetTimerEx("OnPlayerInTutorial",10000,0,"ii",playerid,3);
            return 
1;
        }
        case 
4:
        {
            
//4th message
            
SendClientMessage(playerid,-1,"here the text");
            
SetTimerEx("OnPlayerInTutorial",10000,0,"ii",playerid,5);
            return 
1;
        }
        case 
5:
        {
            
//last tutorial step
            
SendClientMessage(playerid,-1,"here the text");
            
SetTimerEx("OnPlayerInTutorial",10000,0,"ii",playerid,5);
            return 
1;
        }
        case 
6:
        {
            
SendClientMessage(playerid,-1,"You're tutorial is finish.");
            
SpawnPlayer(playerid);
            return 
1;
        }
    }
    return 
1;

You can take SetPlayerCameraPos (+SetPlayerCameraLookAt) or InterpolateCameraPos (+InterpolateCameraLookAt).

SetPlayerCameraPos + SetPlayerCameraLookAt => the camera is on a fix point and show to a fix point
InterpolateCameraPos + InterpolateCameraLookAt => the camera move (you can fix the seconds how long the camera should move)

More information you can get in sa-mp wiki.
hey sorry for bumping, but where do I insert the code?
Reply
#8

On Player connect perhaps(check If he is not registered)
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)