[HELP] /tutorial - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] /tutorial (
/showthread.php?tid=332662)
[HELP] /tutorial -
Bokyyy - 08.04.2012
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?
Re: [HELP] /tutorial -
antonio112 - 08.04.2012
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]);
}
Re: [HELP] /tutorial -
Bokyyy - 08.04.2012
Ok I'll try it, Im sleepy right now, tomorrow I'll post here the results
Re: [HELP] /tutorial -
Bokyyy - 09.04.2012
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;
Re: [HELP] /tutorial -
Shabi RoxX - 09.04.2012
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);
}
Re: [HELP] /tutorial -
Bokyyy - 09.04.2012
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!
Re: [HELP] /tutorial -
Shabi RoxX - 09.04.2012
You are using SetPlayerPos() on player spawn
Re: [HELP] /tutorial -
Bokyyy - 09.04.2012
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 !!