SA-MP Forums Archive
Code is not running correctly. - 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: Code is not running correctly. (/showthread.php?tid=627258)



Code is not running correctly. - SukMathcuck - 25.01.2017

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.

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(i0);
                        
TogglePlayerSpectating(i0);
                        
                        
SetPlayerPos(i1924.1271, -1588.0397, -36.3074);
                        
SetPlayerFacingAngle(i0);
                        
SetPlayerInterior(i1);
                        
SetPlayerVirtualWorld(i, (i+2000));
                        
                        
SetPlayerCameraPos(i1924.4438, -1586.1427, -34.6031);
                        
SetPlayerCameraLookAt(i1924.2791, -1587.1273, -34.6782);
                        
                        
SetCameraBehindPlayer(i);
                        
StopAudioStreamForPlayer(i);
                        
SelectTextDraw(i, -1);
                        
PlayerData[i][pTutorial] = -1;
                        
                        
TextDrawHideForPlayer(iTextDrawTutorial[i]); //Remove textdraw from tutorial
                        
                        
for(new td 23td 34td++)
                            
PlayerTextDrawShow(iPlayerData[i][pTextDraw][td]); //This textdraw is added so that the player can edit objects in his character...
                    

When you press continue, in the textdraw, the player dies, and the textdraw returns.
PHP код:
            else if (playertextid == PlayerData[playerid][pTextDraw][33])
            {
                for(new 
2334++) PlayerTextDrawHide(playeridPlayerData[playerid][pTextDraw][i]);
                for(new 
0100++) SendClientMessage(playerid, -1"");
                
                
SetPlayerPos(playerid1923.7892, -1580.4347, -36.3104);
                
CancelSelectTextDraw(playerid);
                
TogglePlayerControllable(playerid1);
                
PlayerData[playerid][pTutorialStage] = 1;
                
PlayerData[playerid][pTutorialObject] = CreatePlayerObject(playerid15431925.5876, -1572.5621, -36.24400.000090.000010.0000);
                
SetPlayerCheckpoint(playerid1925.5876, -1572.5621, -36.24400.5);
                
SendClientMessage(playeridCOLOR_SEAGREEN"To continue, walk to the item and crouch (pressing 'C').");
                
SetPlayerInterior(playerid1);
                
SetPlayerVirtualWorld(playerid, (playerid+2000));
    
                
SetCameraBehindPlayer(playerid);
                
ShowHungerTextdraw(playerid1);
                
PlayerData[playerid][pThirst] = 80;
            } 
Someone help me to improve this code


Re: Code is not running correctly. - SukMathcuck - 25.01.2017

Up


Re: Code is not running correctly. - Sew_Sumi - 26.01.2017

I think it's going to be more in the editing section of your code than the camera setup... Why do you think that it's in there, and not in the editor?