Issues with a function. -
vIBIENNYx - 26.09.2012
Whenever I execute the code for my "Tutorial" the following issue occurs.
[ame="http://www.youtube.com/watch?v=lEqA58XrhtI"]Problem[/ame]
Here is the code for /tutorialtest
pawn Код:
command(tutorialtest, playerid, params[])
{
StartCutsceneForPlayer(playerid, 1, 1);
return 1;
}
And here's the code for the function.
pawn Код:
if(scene == 8)
{
SetPlayerPos(playerid, -2688.3894, 382.4438, 4.3672);
SetPlayerFacingAngle(playerid, 180);
StopCutsceneForPlayer(playerid);
currscene[playerid] = 0;
currcutscene[playerid] = 0;
StopAudioStreamForPlayer(playerid);
SetPlayerVirtualWorld(playerid, playerid+100);
pInTutorial[playerid] = 1;
new str[128];
format(str, sizeof(str), "Welcome to the tutorial, %s!", PlayerFirstName(playerid));
SendClientMessage(playerid, 0xFFCC9999, str);
SendClientMessage(playerid, 0xFFCC9999, "Pick up a 'i' pickup or icon to continue each part of the tutorial.");
SendClientMessage(playerid, 0xFFCC9999, "You will be prompted on how to finalise the tutorial, once you have finished.");
tutorialpickup[playerid][0] = CreatePickup(1239, 8, -2706.5, 357.1631, 4.4141, playerid);
tutorialpickup[playerid][1] = CreatePickup(1239, 8, -2706.5, 394.4166, 4.3672, playerid);
tutorialpickup[playerid][2] = CreatePickup(1239, 8, -2685.5, 382.2196, 4.3672, playerid);
tutorialpickup[playerid][3] = CreatePickup(1239, 8, -2685.5, 368.2350, 4.3964, playerid);
tutorialpickup[playerid][4] = CreatePickup(1239, 8, -2722.25, 368.0362, 4.3970, playerid);
}
Any ideas?
Re: Issues with a function. -
Rimeau - 26.09.2012
1) The video is private
2) What does the "StopCutsceneForPlayer(playerid);" code look like
Re: Issues with a function. - Emmet_ - 26.09.2012
1) Why didn't you just simply bump your other thread regarding this issue, instead of creating another thread?
https://sampforum.blast.hk/showthread.php?tid=380469
2) Show your StopCutsceneForPlayer code.
Re: Issues with a function. -
vIBIENNYx - 26.09.2012
Here it is:
pawn Код:
stock StopCutsceneForPlayer(playerid)
{
if(pInCutscene[playerid] == 0)
{
//
}
else
{
SetTimerEx("RemoveTextDraw", 1, false, "i",_:WIDESCREEN_TOP[playerid]);
SetTimerEx("RemoveTextDraw", 1, false, "i",_:WIDESCREEN_BOTTOM[playerid]);
SetTimerEx("RemoveTextDraw", 1, false, "i",_:WIDESCREEN_TOP1[playerid]);
SetTimerEx("RemoveTextDraw", 1, false, "i",_:WIDESCREEN_BOTTOM1[playerid]);
SetTimerEx("RemoveTextDraw", 1, false, "i",_:TOP_TEXT1[playerid]);
SetTimerEx("RemoveTextDraw", 1, false, "i",_:TOP_TEXT2[playerid]);
SetTimerEx("RemoveTextDraw", 1, false, "i",_:BOTTOM_TEXT1[playerid]);
SetTimerEx("RemoveTextDraw", 1, false, "i",_:BOTTOM_TEXT2[playerid]);
pInCutscene[playerid] = 0;
}
return 1;
}
And because I forgot about it.. ^^
Re: Issues with a function. - Emmet_ - 26.09.2012
Are you using TogglePlayerSpectating in your code at all?
Re: Issues with a function. -
vIBIENNYx - 26.09.2012
There we go, I just didn't TogglePlayerSpectating(playerid, 0).
Thank you very much, repped you both.