25.01.2017, 17:22
Hello, I have a problem with a script that I did, and I needed your support, because my knowledge has reached the limit, I do not know what is happening with the code, but it is not working properly, maybe it might be missing Something or something is out of place, I'll show below all the script I've done, it's part of a tutorial, I hope it will be my last try.
When you press continue, in the textdraw, the player dies, and the textdraw returns.
Someone help me to improve this code
PHP код:
PlayerData[playerid][pTutorial] = -1;
//This variable is set when the player completes the tutorial.
PHP код:
PlayerData[playerid][pTutorial] = 0;
//This variable is set when the player first created the account.
PHP код:
case 6:
{
InterpolateCameraPos(i, ?, CAMERA_MOVE);
InterpolateCameraLookAt(i, ?, CAMERA_MOVE);
}
case 7:
{
TogglePlayerControllable(i, 0);
TogglePlayerSpectating(i, 0);
SetPlayerPos(i, 1924.1271, -1588.0397, -36.3074);
SetPlayerFacingAngle(i, 0);
SetPlayerInterior(i, 1);
SetPlayerVirtualWorld(i, (i+2000));
SetPlayerCameraPos(i, 1924.4438, -1586.1427, -34.6031);
SetPlayerCameraLookAt(i, 1924.2791, -1587.1273, -34.6782);
SetCameraBehindPlayer(i);
StopAudioStreamForPlayer(i);
SelectTextDraw(i, -1);
PlayerData[i][pTutorial] = -1;
TextDrawHideForPlayer(i, TextDrawTutorial[i]); //Remove textdraw from tutorial
for(new td = 23; td < 34; td++)
PlayerTextDrawShow(i, PlayerData[i][pTextDraw][td]); //This textdraw is added so that the player can edit objects in his character...
}
PHP код:
else if (playertextid == PlayerData[playerid][pTextDraw][33])
{
for(new i = 23; i < 34; i ++) PlayerTextDrawHide(playerid, PlayerData[playerid][pTextDraw][i]);
for(new i = 0; i < 100; i ++) SendClientMessage(playerid, -1, "");
SetPlayerPos(playerid, 1923.7892, -1580.4347, -36.3104);
CancelSelectTextDraw(playerid);
TogglePlayerControllable(playerid, 1);
PlayerData[playerid][pTutorialStage] = 1;
PlayerData[playerid][pTutorialObject] = CreatePlayerObject(playerid, 1543, 1925.5876, -1572.5621, -36.2440, 0.0000, 90.0000, 10.0000);
SetPlayerCheckpoint(playerid, 1925.5876, -1572.5621, -36.2440, 0.5);
SendClientMessage(playerid, COLOR_SEAGREEN, "To continue, walk to the item and crouch (pressing 'C').");
SetPlayerInterior(playerid, 1);
SetPlayerVirtualWorld(playerid, (playerid+2000));
SetCameraBehindPlayer(playerid);
ShowHungerTextdraw(playerid, 1);
PlayerData[playerid][pThirst] = 80;
}