Pawno has stop working
#1

Hello, I when I add this dialog:

Код:
	}
	else if(dialogid == CHOOSELOCATION)
	    {
		    if(response)
		    {
				if(listitem == 0)
			    {
					new szMessage[128];
					SendClientMessageEx(playerid, COLOR_YELLOW2, "You Chosen Los Santos.");
					SendClientMessageEx(playerid, COLOR_LIGHTRED, "Thank you for filling out the information!");
					RegistrationStep[playerid] = 0;
					SetPlayerVirtualWorld(playerid, 0);
					PlayerInfo[playerid][pTut] = 1;
					//gOoc[playerid] = 0; gNews[playerid] = 0; gFam[playerid] = 0;
					TogglePlayerControllable(playerid, 1);
					SetCamBack(playerid);
					DeletePVar(playerid, "MedicBill");
					SetPlayerColor(playerid,TEAM_HIT_COLOR);
					for(new x;x<10000;x++)
					{
						new rand=random(300);
						if(PlayerInfo[playerid][pSex] == 0)
						{
							if(IsValidSkin(rand) && IsFemaleSpawnSkin(rand))
							{
								PlayerInfo[playerid][pModel] = rand;
								SetPlayerSkin(playerid, rand);
								break;
							}
						}
						else
						{
							if(IsValidSkin(rand) && !IsFemaleSkin(rand))
							{
								PlayerInfo[playerid][pModel] = rand;
								SetPlayerSkin(playerid, rand);
								break;
							}
						}
					}
					format(szMessage, sizeof(szMessage), "{AA3333}Setup{FFFF00}: %s (%d) has joined Crystal Generation Roleplay.", GetPlayerNameEx(playerid), playerid);
					ABroadCast(COLOR_LIGHTRED,szMessage, 2);
					SendClientMessageEx(playerid,COLOR_YELLOW,"Welcome to Los Santos!");
					SendClientMessageEx(playerid, COLOR_WHITE, "If you need help do /requesthelp and someone will come help you.");
					SendClientMessageEx(playerid, COLOR_WHITE, "Please follow Server Rules to prevent being Jailed/Banned.");
                    SendClientMessageEx(playerid, COLOR_WHITE, "You have been automatically refunded, please do not report for more. Do not report for a faction/family; see our forums for that.");
					SetPlayerPosEx(playerid, 1715.1201,-1903.1711,13.5665);
					SetPlayerFacingAngle(playerid, 360.0);
					SetCameraBehindPlayer(playerid);
					SetPlayerInterior(playerid,0);
					PlayerInfo[playerid][pVIPM] = VIPM;
					VIPM++;
					PlayerInfo[playerid][pVIPExpire] = gettime()+2592000;
					PlayerInfo[playerid][pDonateRank] = 2;
					PlayerInfo[playerid][pTempVIP] = 0;
					PlayerInfo[playerid][pBuddyInvited] = 0;
					PlayerInfo[playerid][pGVip] = 0;
                    SetPVarInt(playerid, "VehicleRefund", 1);
                    SendClientMessageEx(playerid, COLOR_ORANGE, "* You have been allowed one free vehicle! (/vrefund)");
				}
			}
			else
			{
			    ShowPlayerDialog(playerid, REGISTERAGE, DIALOG_STYLE_LIST, "{FF0000}What is your characters age?", string, "Submit", "");
			}
		}
		return 1;
	}
In my script and compile it pawno has stopped working.

when I remove it I can compile it again does anyone know what the problem is ?
Reply
#2

Add Your Script On
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[]) 
Reply
#3

Probably missed a bracket.
Reply
#4

Does it actually stop working and crashes the whole pawno or it just says "Stopped working" in the compiler?
Reply
#5

Already got that in my script
Reply
#6

What can be wrong with this then ?

when I compile it it has "Stopped Working"

Код:
if(dialogid == CHOOSELOCATION)
	    {
		    if(response)
		    {
				if(listitem == 0)
			    {
					new szMessage[128];
					SendClientMessageEx(playerid, COLOR_YELLOW2, "You Chosen Los Santos.");
					SendClientMessageEx(playerid, COLOR_LIGHTRED, "Thank you for filling out the information!");
					RegistrationStep[playerid] = 0;
					SetPlayerVirtualWorld(playerid, 0);
					PlayerInfo[playerid][pTut] = 1;
					//gOoc[playerid] = 0; gNews[playerid] = 0; gFam[playerid] = 0;
					TogglePlayerControllable(playerid, 1);
					SetCamBack(playerid);
					DeletePVar(playerid, "MedicBill");
					SetPlayerColor(playerid,TEAM_HIT_COLOR);
					for(new x;x<10000;x++)
					{
						new rand=random(300);
						if(PlayerInfo[playerid][pSex] == 0)
						{
							if(IsValidSkin(rand) && IsFemaleSpawnSkin(rand))
							{
								PlayerInfo[playerid][pModel] = rand;
								SetPlayerSkin(playerid, rand);
								break;
							}
						}
						else
						{
							if(IsValidSkin(rand) && !IsFemaleSkin(rand))
							{
								PlayerInfo[playerid][pModel] = rand;
								SetPlayerSkin(playerid, rand);
								break;
							}
						}
					}
					format(szMessage, sizeof(szMessage), "{AA3333}Setup{FFFF00}: %s (%d) has joined Crystal Generation Roleplay.", GetPlayerNameEx(playerid), playerid);
					ABroadCast(COLOR_LIGHTRED,szMessage, 2);
					SendClientMessageEx(playerid,COLOR_YELLOW,"Welcome to Los Santos!");
					SendClientMessageEx(playerid, COLOR_WHITE, "If you need help do /requesthelp and someone will come help you.");
					SendClientMessageEx(playerid, COLOR_WHITE, "Please follow Server Rules to prevent being Jailed/Banned.");
                    SendClientMessageEx(playerid, COLOR_WHITE, "You have been automatically refunded, please do not report for more. Do not report for a faction/family; see our forums for that.");
					SetPlayerPosEx(playerid, 1715.1201,-1903.1711,13.5665);
					SetPlayerFacingAngle(playerid, 360.0);
					SetCameraBehindPlayer(playerid);
					SetPlayerInterior(playerid,0);
					PlayerInfo[playerid][pVIPM] = VIPM;
					VIPM++;
					PlayerInfo[playerid][pVIPExpire] = gettime()+2592000;
					PlayerInfo[playerid][pDonateRank] = 2;
					PlayerInfo[playerid][pTempVIP] = 0;
					PlayerInfo[playerid][pBuddyInvited] = 0;
					PlayerInfo[playerid][pGVip] = 0;
                    SetPVarInt(playerid, "VehicleRefund", 1);
                    SendClientMessageEx(playerid, COLOR_ORANGE, "* You have been allowed one free vehicle! (/vrefund)");
				}
			}
  		}
	}
Reply
#7

Quote:
Originally Posted by AroseKhanNiazi
Посмотреть сообщение
Probably missed a bracket.
^
Yeah you missed a bracket, you have 9 open ones and 8 closed.
Edited: Try re-counting them, missing a bracket can sometimes make the compiler crash.
Reply
#8

So what does that means ? How can I add that missed bracket ? and where does it miss ? :O
Reply
#9

Like I said try re-counting them, maybe one is missing or delete every bracket in the code and add them again.
Reply
#10

Problem has been solved, thanks for the help guys!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)