Jump to content
  • 0

problema dialog


kiLLersx

Question

Problema intalnita (descriere): am facut dialog pe /job sati iei job-ul direct de acolo dar nu imi da jobul nici mesajul .. 
Ero(area / rile) / warning-(ul / urile):
Liniile de cod / sursa / script-ul(obligatoriu): 

	if(response)// They pressed the first button. 
    {
    switch(dialogid == 555)// If you only have one dialog, then this isn't required, but it's neater for when you implement more dialogs. 
        {
		case 0:// Our dialog!
    	    {
           	switch(listitem)// Checking which listitem was selected
        	{
        	    case 0:// detective
        	    {
        	        PlayerInfo[playerid][pJob] = 1; 
					SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul detective .");
					return 1;
        	    }
        	    case 1: // avocat
        	    {
        	        PlayerInfo[playerid][pJob] = 2; 
					SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul avocat .");  
					return 1;
        	    }
        	    case 2: // drug dealer
        	    {
        	        PlayerInfo[playerid][pJob] = 3; 
					SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul drug dealer .");  
					return 1;
        	    }
				case 3: // car mecanic
        	    {
        	        PlayerInfo[playerid][pJob] = 4; 
					SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul mecanic .");  
					return 1;
        	    }
				case 4: // arms dealer
        	    {
        	        PlayerInfo[playerid][pJob] = 5; 
					SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul arms dealer .");  
					return 1;
        	    }
				case 5: // bus driver
        	    {
        	        PlayerInfo[playerid][pJob] = 6; 
					SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul bus driver .");  
					return 1;
        	    }
				case 6: // paper boy
        	    {
        	        PlayerInfo[playerid][pJob] = 7; 
					SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul paper boy .");  
					return 1;
        	    }
				case 7: // trucker
        	    {
        	        PlayerInfo[playerid][pJob] = 8; 
					SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul trucker .");  
					return 1;
        	    }
				case 8: // distribuitor de petrol
        	    {
        	        PlayerInfo[playerid][pJob] = 9; 
					SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul distribuitor de petrol .");  
					return 1;
        	    }
				case 9: // fermier
        	    {
        	        PlayerInfo[playerid][pJob] = 10; 
					SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul fermier .");  
					return 1;
        	    }
        	}
    	    }
		}
    }


Imagini / Video (optional):
Ati incercat sa rezolvati singur?: da

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

  • 0

La inceputul scriptului adaugi:

#define DIALOG_JOBS 123 //1000 este id-ul. Daca mai ai un dialog cu acelasi id, il schimbi pe acesta cu al numar. Ex: 1100.

Dupa la OnPlayerCommandText creezi comanda in felul urmator:

if(!strcmp(cmdtext, "/jobs", true))
{
    ShowPlayerDialog(playerid, DIALOG_JOBS , DIALOG_STYLE_LIST, "JOBS",Commands, "Select", "Close" );
    return 1;
}

Iar la OnDialogResponse faci in felul urmator:

case DIALOG_JOBS:
		{
			if(response)
			{
				if(listitem==0)
				{
				PlayerInfo[playerid][pJob] = 1; 
				SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul detective .");
			    }
			    if(listitem==1)
				{
				PlayerInfo[playerid][pJob] = 2; 
				SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul avocat .");  
			    }
			    if(listitem==2)
				{
				PlayerInfo[playerid][pJob] = 3; 
				SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul drug dealer .");  
			    }
			    if(listitem==3)
				{
				PlayerInfo[playerid][pJob] = 4; 
				SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul mecanic .");
			    }
			    if(listitem==4)
				{
				PlayerInfo[playerid][pJob] = 5; 
				SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul arms dealer .");  
			    }
			    if(listitem==5)
				{
				PlayerInfo[playerid][pJob] = 6; 
				SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul bus driver .");  
			    }
			    if(listitem==6)
				{
				PlayerInfo[playerid][pJob] = 7; 
				SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul paper boy .");
			    }
			    if(listitem==7)
				{
				PlayerInfo[playerid][pJob] = 8; 
				SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul trucker .");
			    }
			    if(listitem==8)
				{
				PlayerInfo[playerid][pJob] = 9; 
				SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul distribuitor de petrol .");
			    }
			    if(listitem==9)
				{
				PlayerInfo[playerid][pJob] = 10; 
				SendClientMessage(playerid, 0xFFFFFF, "Acum ai jobul fermier .");
			    }
		    }
		}

Sper ca ti-am fost de ajutor.

Edited by Reflex
Link to comment
Share on other sites

  • 0
  • 0
if(strcmp(cmd,"/job",true)==0)
    {
        if(IsPlayerConnected(playerid))
	    {
			ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_LIST, "Joburi Disponibile", "Detectiv \nAvocat \nDrug Dealer\nCar Mechanic\nArms Dealer\nBus Driver\nPaper Boy\nTrucker\nDistribuitor de Petrol\nFermier", "Purchase", "Cancel");
			
		}
		return 1;
	}

 

Link to comment
Share on other sites

  • 0
Link to comment
Share on other sites

  • 0

Incearca asa:

CMD:job
    {
        if(IsPlayerConnected(playerid))
	    {
			ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_LIST, "Joburi Disponibile", "Detectiv \nAvocat \nDrug Dealer\nCar Mechanic\nArms Dealer\nBus Driver\nPaper Boy\nTrucker\nDistribuitor de Petrol\nFermier", "Purchase", "Cancel");
			
		}
		return 1;
}

Sau:

if(strcmp(cmd,"/job",true))
    {
        if(IsPlayerConnected(playerid))
	    {
			ShowPlayerDialog(playerid, DIALOG_JOBS, DIALOG_STYLE_LIST, "Joburi Disponibile", "Detectiv \nAvocat \nDrug Dealer\nCar Mechanic\nArms Dealer\nBus Driver\nPaper Boy\nTrucker\nDistribuitor de Petrol\nFermier", "Purchase", "Cancel");
			
		}
		return 1;
}

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.