How can I close this section duhh.. IDK! Help lol...
#1

Yeah this is hard to understand what I'm trying to ask here

But I'm working on some dialogs and I cant get the closing brackets right.. Its the end of that dialog and after these,
Код:
       	    {
	            SendCilentMessage(playerid, COLOR_NEWBIE, "Server closed the connection");
				}
    		}
		    return 1;
		}
it moves on to the next dialog (not the one im working on, a whole different one)


So how do I close that section?
Cheers
Reply
#2

Call me stupid but i don't understand this code..please show me all :/
Reply
#3

Post the whole thing, I will fix it for you... This is what happen when your indent style is undefined...
http://en.wikipedia.org/wiki/Indent_style
Reply
#4

Yeah call me dumb, I'm just learning this dialog stuff :/


Код:
	
if(dialogid == 138)// They pressed the first button.
    {
    switch(138)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
		case 1:// Our dialog!
    	    {
           	switch(listitem)// Checking which listitem was selected
        	{
        	    case 0:// The first item listed
        	    {
				PlayerInfo[playerid][pTut] = 1;
				gOoc[playerid] = 0; gNews[playerid] = 0; gFam[playerid] = 0;
				ClearChatbox(playerid);
				TogglePlayerControllable(playerid, 1);
				SetCamBack(playerid);
				DeletePVar(playerid, "MedicBill");
				SetPlayerColor(playerid,TEAM_HIT_COLOR);
				SetPlayerInterior(playerid,0);
				SetPlayerPos(playerid, 1507.8495,-1688.9045,15.1903);
				SetPlayerFacingAngle(playerid, 174.1660);
				SetCameraBehindPlayer(playerid);
				SetPlayerVirtualWorld(playerid, 0);

				SetPlayerInterior(playerid,0);
				SetPlayerPos(playerid, 1507.8495,-1688.9045,15.1903);
				SetPlayerFacingAngle(playerid, 174.1660);
				SetCameraBehindPlayer(playerid);
				TogglePlayerControllable(playerid, 1);

				//some shitty rp messages here
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have spawned! Welcome to Larceny Roleplay. ");

	            //set player stats
				PlayerInfo[playerid][pLevel] = 1;
				PlayerInfo[playerid][pDonateRank] = 3;
				GivePlayerCash(playerid, 150000);
				PlayerInfo[playerid][pMats] = 100;
				PlayerInfo[playerid][pPot] = 5;
				PlayerInfo[playerid][pCrack] = 5;
				PlayerInfo[playerid][pAccount] = 30000;
				PlayerInfo[playerid][pConnectTime] = 1;
				SetPlayerSkin(playerid, 7);
				PlayerInfo[playerid][pChar] = 7;
				PlayerInfo[playerid][pModel] = 7;
				}
        	    case 1: // The second item listed
        	    {
	            SendCilentMessage(playerid, COLOR_NEWBIE, "Server closed the connection");
				}
    		}
		    return 1;
		}
Reply
#5

Why not try to remove this

pawn Код:
case 1:// Our dialog!
            {
Reply
#6

coz isn't that the opening thinggy of the case?

EDIT: Just tried it, didn't work
Reply
#7

Quote:
Originally Posted by KyleSta123
Посмотреть сообщение
Yeah call me dumb, I'm just learning this dialog stuff :/


Код:
	
if(dialogid == 138)// They pressed the first button.
    {
    switch(138)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs.
        {
		case 1:// Our dialog!
    	    {
           	switch(listitem)// Checking which listitem was selected
        	{
        	    case 0:// The first item listed
        	    {
				PlayerInfo[playerid][pTut] = 1;
				gOoc[playerid] = 0; gNews[playerid] = 0; gFam[playerid] = 0;
				ClearChatbox(playerid);
				TogglePlayerControllable(playerid, 1);
				SetCamBack(playerid);
				DeletePVar(playerid, "MedicBill");
				SetPlayerColor(playerid,TEAM_HIT_COLOR);
				SetPlayerInterior(playerid,0);
				SetPlayerPos(playerid, 1507.8495,-1688.9045,15.1903);
				SetPlayerFacingAngle(playerid, 174.1660);
				SetCameraBehindPlayer(playerid);
				SetPlayerVirtualWorld(playerid, 0);

				SetPlayerInterior(playerid,0);
				SetPlayerPos(playerid, 1507.8495,-1688.9045,15.1903);
				SetPlayerFacingAngle(playerid, 174.1660);
				SetCameraBehindPlayer(playerid);
				TogglePlayerControllable(playerid, 1);

				//some shitty rp messages here
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "You have spawned! Welcome to Larceny Roleplay. ");

	            //set player stats
				PlayerInfo[playerid][pLevel] = 1;
				PlayerInfo[playerid][pDonateRank] = 3;
				GivePlayerCash(playerid, 150000);
				PlayerInfo[playerid][pMats] = 100;
				PlayerInfo[playerid][pPot] = 5;
				PlayerInfo[playerid][pCrack] = 5;
				PlayerInfo[playerid][pAccount] = 30000;
				PlayerInfo[playerid][pConnectTime] = 1;
				SetPlayerSkin(playerid, 7);
				PlayerInfo[playerid][pChar] = 7;
				PlayerInfo[playerid][pModel] = 7;
				}
        	    case 1: // The second item listed
        	    {
	            SendCilentMessage(playerid, COLOR_NEWBIE, "Server closed the connection");
				}
    		}
		    return 1;
		}
What the... Your code is all messed up and it's not worth fixing. Please read and understand more about dialogs first:
https://sampforum.blast.hk/showthread.php?tid=109610
or read the wiki.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)