dialog help
#1

Can someone please help me & teach me how to do this properly rather than make fun of me?

Код:
C:\Users\User\Desktop\SAMP Scripting\script2\gamemodes\DM.pwn(1730) : error 002: only a single statement (or expression) can follow each "case"
C:\Users\User\Desktop\SAMP Scripting\script2\gamemodes\DM.pwn(1730) : warning 215: expression has no effect
C:\Users\User\Desktop\SAMP Scripting\script2\gamemodes\DM.pwn(1735) : warning 217: loose indentation
C:\Users\User\Desktop\SAMP Scripting\script2\gamemodes\DM.pwn(1735) : error 021: symbol already defined: "playerName"
C:\Users\User\Desktop\SAMP Scripting\script2\gamemodes\DM.pwn(1737) : error 014: invalid statement; not in switch
C:\Users\User\Desktop\SAMP Scripting\script2\gamemodes\DM.pwn(1737) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\SAMP Scripting\script2\gamemodes\DM.pwn(1737 -- 1738) : error 029: invalid expression, assumed zero
C:\Users\User\Desktop\SAMP Scripting\script2\gamemodes\DM.pwn(1737 -- 1738) : fatal error 107: too many error messages on one line
Код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
	new string[128], playerName[MAX_PLAYER_NAME];
	GetPlayerName(playerid, playerName, sizeof(playerName));
	switch(dialogid)
	{
		case 1:
		{
			switch(response)
			{
			case 0:
		    {
		        InDM[playerid] = true;
		        DM[playerid] = 0;
		 		SpawnPlayer(playerid);
			}
			case 1:
			{
				InDM[playerid] = true;
			    DM[playerid] = 1;
			    SpawnPlayer(playerid);
			}
			case 2:
			{
			    InDM[playerid] = true;
			    DM[playerid] = 2;
			   	SpawnPlayer(playerid);
			}
			case 3:
			{
				InDM[playerid] = true;
			    DM[playerid] = 3;
			    SpawnPlayer(playerid);
			}
			case 4:
			{
				InDM[playerid] = true;
			    DM[playerid] = 4;
			    SpawnPlayer(playerid);
			}
			case 5:
			{
			    InDM[playerid] = true;
		        DM[playerid] = 5;
		        SpawnPlayer(playerid);
		    }
			case 6:
			{
			    InDM[playerid] = true;
			    DM[playerid] = 6;
			    SpawnPlayer(playerid);
			}
			case 7:
			{
			    InDM[playerid] = true;
			    DM[playerid] = 7;
			    SpawnPlayer(playerid);
			}
			case 8:
			{
				InDM[playerid] = true;
			    DM[playerid] = 8;
			    SpawnPlayer(playerid);
			}
			case 9:
			{
				InDM[playerid] = true;
			    DM[playerid] = 9;
			    SpawnPlayer(playerid);
			}
            case 10:
			{
				InDM[playerid] = true;
			    DM[playerid] = 10;
			    SpawnPlayer(playerid);
			}
			format(string, sizeof(string), "{77B3D9}[DM Zones] {ffffff}%s(%i) has just entered {77B3D9}DM zone %i {ffffff}(/dm)", playerName, playerid, DM[playerid]);
			SendClientMessageToAll(-1, string);
			return 1;
			}	
		}
		new string3[128], playerName[MAX_PLAYER_NAME];
		GetPlayerName(playerid, playerName, sizeof(playerName));
		case: 2 //tdm
		{
			switch(response)
			{
					case 0:
					{
						InTDM[playerid] = true;
						TDM[playerid] = 0;
						SpawnPlayer(playerid);
					}
					case 1:
					{
						InTDM[playerid] = true;
						TDM[playerid] = 1;
						SpawnPlayer(playerid);
					}
					case 2:
					{
						InTDM[playerid] = true;
						TDM[playerid] = 2;
						Spawnplayer(playerid);
					}
					format(string3, sizeof(string3), "[TDM] %s(%i) has just entered TDM with the team %s(/tdm)", playerName, playerid, TDM[playerid]);
					SendClientMessageToAll(-1, string3);
					return 1;
				}
			}
		}
	}
 	return 0;
}
Reply
#2

I believe the “PlayerName” is already somewhere in your script,
Anyway make it like PlayerName2 and the “switch (response)” make it “switch (listitem)”

As response can only be 0 or 1.

Compile and let us see.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)