SA-MP Forums Archive
Pawno crashing - 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: Pawno crashing (/showthread.php?tid=610743)



Pawno crashing - IndependentGaming - 27.06.2016

Hello, I'm fixing/add some new things to the tutorial but when I add this:

Код:
for(new t = 0; t < 11; t++)
				{
					TextDrawShowForPlayer(playerid, TutTxtDraw[t]);
				}

				TutorialProgress[playerid] = 1;

				SetTimerEx("TutorialProgression", 14500, 0, "d", playerid);
				}
It looks like :

Код:
else {
			    format(string, sizeof(string), "Nobody");
				strmid(PlayerInfo[playerid][pReferredBy], string, 0, strlen(string), MAX_PLAYER_NAME);
  				SendClientMessageEx(playerid, COLOR_LIGHTRED, "Thanks for filling in all the information, now you can proceed to the tutorial!");
				RegistrationStep[playerid] = 3;
				SetPlayerVirtualWorld(playerid, 0);
				ClearChatbox(playerid);
				ShowTutGUIBox(playerid);
				ShowTutGUIFrame(playerid, 1);
				TutStep[playerid] = 1;
				for(new t = 0; t < 11; t++)
				{
					TextDrawShowForPlayer(playerid, TutTxtDraw[t]);
				}

				TutorialProgress[playerid] = 1;

				SetTimerEx("TutorialProgression", 14500, 0, "d", playerid);
				}
    			//TextDrawShowForPlayer(playerid, txtNationSelHelper);
				//TextDrawShowForPlayer(playerid, txtNationSelMain);
				//PlayerNationSelection[playerid] = -1;

			//	Streamer_UpdateEx(playerid, 1607.0160,-1510.8218,207.4438);
			//	SetPlayerPos(playerid, 1607.0160,-1510.8218,-10.0);
			//	SetPlayerCameraPos(playerid, 1850.1813,-1765.7552,81.9271);
			//	SetPlayerCameraLookAt(playerid, 1607.0160,-1510.8218,207.4438);
				SetPlayerVirtualWorld(playerid, 0);
				SetPlayerInterior(playerid, 0);
				Streamer_UpdateEx(playerid,1319.4899, 228.6382, 19.5547);
				SetPlayerPos(playerid,1319.4899, 228.6382, 19.5547);
				SetPlayerFacingAngle(playerid, 336.1479);
				TogglePlayerSpectating(playerid, 1);
				InterpolateCameraPos(playerid, 1096.835693, 428.082794, 48.468730, 1425.695922, 94.670745, 65.867767, 25000);
				InterpolateCameraLookAt(playerid, 1101.151000, 425.830383, 47.326560, 1424.072631, 99.209724, 64.540138, 25000);
			}
		}
	}
my pawno crashes how can I add that so my pawno will compile without errors ?


Re: Pawno crashing - Battlezone - 27.06.2016

Use Missing Brackets finder : Place it into your gamemode folder and check if there are extra brackets.
Also, it is not a good habit to write your code like that, you should properly indent your codes.


Re: Pawno crashing - Konstantinos - 27.06.2016

Probably an issue with brackets. I just indented your code and it looks like this:
PHP код:

            
else
            {
                
format(stringsizeof(string), "Nobody");
                
strmid(PlayerInfo[playerid][pReferredBy], string0strlen(string), MAX_PLAYER_NAME);
                
SendClientMessageEx(playeridCOLOR_LIGHTRED"Thanks for filling in all the information, now you can proceed to the tutorial!");
                
RegistrationStep[playerid] = 3;
                
SetPlayerVirtualWorld(playerid0);
                
ClearChatbox(playerid);
                
ShowTutGUIBox(playerid);
                
ShowTutGUIFrame(playerid1);
                
TutStep[playerid] = 1;
                for (new 
011t++)
                {
                    
TextDrawShowForPlayer(playeridTutTxtDraw[t]);
                }
                
TutorialProgress[playerid] = 1;
                
SetTimerEx("TutorialProgression"145000"d"playerid);
            }
            
//TextDrawShowForPlayer(playerid, txtNationSelHelper);
            //TextDrawShowForPlayer(playerid, txtNationSelMain);
            //PlayerNationSelection[playerid] = -1;
            //    Streamer_UpdateEx(playerid, 1607.0160,-1510.8218,207.4438);
            //    SetPlayerPos(playerid, 1607.0160,-1510.8218,-10.0);
            //    SetPlayerCameraPos(playerid, 1850.1813,-1765.7552,81.9271);
            //    SetPlayerCameraLookAt(playerid, 1607.0160,-1510.8218,207.4438);
            
SetPlayerVirtualWorld(playerid0);
            
SetPlayerInterior(playerid0);
            
Streamer_UpdateEx(playerid1319.4899228.638219.5547);
            
SetPlayerPos(playerid1319.4899228.638219.5547);
            
SetPlayerFacingAngle(playerid336.1479);
            
TogglePlayerSpectating(playerid1);
            
InterpolateCameraPos(playerid1096.835693428.08279448.4687301425.69592294.67074565.86776725000);
            
InterpolateCameraLookAt(playerid1101.151000425.83038347.3265601424.07263199.20972464.54013825000);
        }
    }

Unless you post the whole function, I can't say for certain if there are missing or extra.


Re: Pawno crashing - nemanjasepa - 30.06.2016

It must be missing or { }. Missing Brackets Finder is good program for that..