Register Age
#1

I get :
Quote:

C:\Users\Callum Riley\Desktop\BBRP\gamemodes\brp.pwn(771) : error 014: invalid statement; not in switch
C:\Users\Callum Riley\Desktop\BBRP\gamemodes\brp.pwn(771) : warning 215: expression has no effect
C:\Users\Callum Riley\Desktop\BBRP\gamemodes\brp.pwn(771) : error 001: expected token: ";", but found ":"
C:\Users\Callum Riley\Desktop\BBRP\gamemodes\brp.pwn(771) : error 029: invalid expression, assumed zero
C:\Users\Callum Riley\Desktop\BBRP\gamemodes\brp.pwn(771) : fatal error 107: too many error messages on one line

For:

Код:
		case DIALOG_GENDER:
		{
			if(response)
	        {
	            switch(listitem)
	            {
	                case 0:
					{
						new stringdiag[410];
						PlayerInfo[playerid][Gender] = 1;
						SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have defined your gender to be male.");
						SetPlayerSkin(playerid, 291);
   						ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_LIST, "{33CCFF}What is your characters age? - BlueBerry Roleplay", stringdiag, "Submit", "Quit");
					}
	                case 1:
					{
					    new stringdiag[410];
						PlayerInfo[playerid][Gender] = 2;
						SendClientMessage(playerid, 0x46E850FF, "SERVER:{FFFFFF} You have defined your gender to be female.");
						SetPlayerSkin(playerid, 233);
   						ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_LIST, "{33CCFF}What is your characters age? - BlueBerry Roleplay", stringdiag, "Submit", "Quit");
					}
				}
		    }
		    
			case DIALOG_AGE:LINE 771
			{
				if(response)
				{
					new stringdiag2[410];
					new tmp2[256];
					new playername2[MAX_PLAYER_NAME];
					for(new x=1;x<11;x++)
					{
						format(stringdiag2, sizeof(stringdiag2), "%s%d\n", stringdiag2, x);
					}
					PlayerInfo[playerid][Age] = listitem+15;
					format(string, sizeof(string), "Ok, so you are %d year old.",PlayerInfo[playerid][Age]);
					SendClientMessage(playerid, COLOR_LIGHTRED, string);
					format(tmp2, sizeof(tmp2), "~w~Welcome~n~~y~%s~n~~h~~b~BlueBerryRoleplay.com", playername2);
					GameTextForPlayer(playerid, tmp2, 5000, 1);
					SetSpawnInfo(playerid, 0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0);
   					SpawnPlayer(playerid);
				}
				else
				{
					new stringdiag2[410];
					new tmp2[256];
					new playername2[MAX_PLAYER_NAME];
  					ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_LIST, "{33CCFF}What is your characters age? - BlueBerry Roleplay", stringdiag2, "Submit", "");
					format(tmp2, sizeof(tmp2), "~w~Welcome~n~~y~%s~n~~h~~b~BlueBerryRoleplay.com", playername2);
					GameTextForPlayer(playerid, tmp2, 5000, 1);
					SetSpawnInfo(playerid, 0, 0, 0.00, 0.00, 0.00, 0.00, 0, 0, 0, 0, 0, 0);
  					SpawnPlayer(playerid);
				}
			}
		}
Reply
#2

It's in the DIALOG_GENDER case.
Reply
#3

Could you like, edit the code so it is not?
Reply
#4

It isn't that hard. You just have to close the end bracket of case DIALOG_GENDER before case DIALOG_AGE and not after it.

You have this:
PHP код:
case DIALOG_GENDER: {
    
// Code
    
case DIALOG_AGE: {
        
// Code
    
}

While it should be this:
PHP код:
case DIALOG_GENDER: {
    
// Code
}
case 
DIALOG_AGE: {
    
// Code

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)