Spawn Dialog Problem
#1

Hello

When i Click Button1 = "SPAWN"
Nothing Will Happen & Dialog Button 1 won't do anything

plz help


Код:
 OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch( dialogid )
    {
        case 1:
        {
            if( response )
            {
                switch( listitem )
				{

                    case 0: // Class 1
                    {
						ShowPlayerDialog(playerid, DIALOG_SPAWN_CLASS, DIALOG_STYLE_LIST, "Shahre Khod Ra Entekhab Namaed", "{FFFF00}AazarBayijan\n{FFFF00}Ardebil\n{FFFF00}Oroomie\n{FFFF00}Zanjan", "{FF0000}SPAWN", "{008000}Khoruj");
						{
                        	switch(dialogid)
                        	{
								case DIALOG_SPAWN_CLASS:
								{
								    if(response == DIALOG_SPAWN_CLASS)
								    {
								        switch(listitem)
								        {
								            case 0:
								            {
              				 					SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
     											SpawnPlayer(playerid);
     											SetPlayerColor(playerid, COLOR_YELLOW);
								            
								            }
								        }
							     	}
								}
                        	
							}



						}
						         // add your spawn positions.. or w.e

                    }
                    case 1: //class 2
                    {
                    }
                    case 2: // class 3
                    {
                    }
                    // and soo on
                }
            }
            else
            {
                ShowPlayerDialog( playerid, DIALOG_SPAWN_CLASS, DIALOG_STYLE_LIST, "Select Your Class:-", "CLASS 1\nCLASS2\nCLASS 3", "Select", "Cancel" );
            }
        }
Reply
#2

Try this:
Код:
forward OnLogin(playerid);// definim callback ul
public OnLogin(playerid)// facem publicul
{
	printf("OnLogin called");
	SetSpawnInfo( playerid, 0, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0 );
	SpawnPlayer(playerid);
	SetPlayerColor(playerid, COLOR_YELLOW);         
	return 1;		
}
Код:
case DIALOG_SPAWN_CLASS:
								{
								    if(response == DIALOG_SPAWN_CLASS)
								    {
								        switch(listitem)
								        {
								            case 0:
								            {
              				 					OnLogin(playerid);
								            
								            }
								        }
							     	}
								}
and show if you have message in console.
Reply
#3

Dadash ino test kon:
Albate khodam test nakardam.
PHP код:
public OnDialogResponse(playeriddialogidresponselistiteminputtext[])
{
    switch(
dialogid)
    {
        case 
1:
        {
            if(
response)
            {
                switch(
listitem)
                {
                    case 
0// Class 1
                    
{
                        
ShowPlayerDialog(playeridDIALOG_SPAWN_CLASSDIALOG_STYLE_LIST"Shahre Khod Ra Entekhab Namaed""{FFFF00}AazarBayijan\n{FFFF00}Ardebil\n{FFFF00}Oroomie\n{FFFF00}Zanjan""{FF0000}SPAWN""{008000}Khoruj");
                    }
                    case 
2:...
                }
            }
        }
        case 
DIALOG_SPAWN_CLASS:
        {
            if(
response)
            {
                switch(
listitem)
                {
                    case 
0:
                    {
                        
SetSpawnInfo(playerid001958.331343.1215.36269.1526362815000);
                        
SpawnPlayer(playerid);
                        
SetPlayerColor(playeridCOLOR_YELLOW);
                       }
                }
                
            }
        }
    }
    return 
0;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)