Jump to content
  • 0

Ajutor dialog


Issey

Question

Problema intalnita (descriere):Salut, am problema cu un dialog, cand scriu comanda : "/buylicenses" apare dialogul,dar cand dau de exemplu pe Flying , nu se intampla nimic , nu imi da nici licenta , nu imi ia nici banii , nu apare nici mesajul.. si nu inteleg..cred ca am uitat ceva ..sper sa ma ajutati voi
Ero(area / rile) / warning-(ul / urile):-
Liniile de cod / sursa / script-ul(obligatoriu):

#define buylicenses 290198

if(strcmp("/buylicenses", cmdtext, true) == 0)
  	{
  		if(IsPlayerConnected(playerid))
       	{
			if(PlayerToPoint(3.0,playerid,1617.2471,-1741.3779,500.377))
          	{
   			ShowPlayerDialog(playerid, 290198, DIALOG_STYLE_LIST, "BlackUnion Licenses", "Flying\nSailing\nWeapon\nFishing", "Ok", "Iesire");
   			return 1;
    		}
		}
	}
	
	if(dialogid == 290198)
	{
		if(!response)//daca apasam pe primul buton, adica Ok
  		{
   			if(listitem == 0)//daca dam click pe prima varianta, in cazul nostru Varianta1
   			{
     		if(PlayerInfo[playerid][pFlyLic] == 0)
				{
				    if(GetPlayerCash(playerid) < 10000)
				    {
             		    SendClientMessage(playerid, COLOR_GREY, "Nu ai bani destui for a flying license");
             		    return 1;
             		}
             		else
             		{
             			SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a flying license for $10,000");
             			GivePlayerCash(playerid, - 10000);
             			PlayerInfo[playerid][pFlyLic] = 1;
             			OnPlayerUpdateEx(playerid);
             		}
				}
				else
				{
					SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a flying license");
					return 1;
				}
   			}
		   	if(listitem == 1)//daca dam click pe a 2-a varianta, adica Varianta2
		   	{
                if(PlayerInfo[playerid][pBoatLic] == 0)
				{
				    if(GetPlayerCash(playerid) < 10000)
				    {
				        SendClientMessage(playerid, COLOR_GREY, "Nu ai bani destui for a sailing license");
				        return 1;
				    }
				    else
				    {
             			SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a boat license for $10,000");
             			GivePlayerCash(playerid, - 10000);
             			PlayerInfo[playerid][pBoatLic] = 1;
             			OnPlayerUpdateEx(playerid);
             		}
				}
				else
				{
					SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a boat license");
					return 1;
				}
		   	}
		   	if(listitem == 2)//daca dam click pe a 3-a varianta, adica Varianta3
		   	{
		   		if(PlayerInfo[playerid][pGunLic] == 0)
				{
				    if(GetPlayerCash(playerid) < 10000)
				    {
				        SendClientMessage(playerid, COLOR_GREY, "Nu ai bani destui for a gun license");
				        return 1;
				    }
				    else
				    {
             			SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a gun license for $10,000");
             			GivePlayerCash(playerid, - 10000);
             			PlayerInfo[playerid][pGunLic] = 1;
             			OnPlayerUpdateEx(playerid);
             		}
				}
				else
				{
					SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a gun license");
					return 1;
				}
		   	}
		   	if(listitem == 3)//daca dam click pe a 4-a varianta, adica Varianta4
		   	{
		     	if(PlayerInfo[playerid][pFishLic] == 0)
				{
				    if(GetPlayerCash(playerid) < 10000)
				    {
				        SendClientMessage(playerid, COLOR_GREY, "Nu ai bani destui for a fishing license");
				        return 1;
				    }
				    else
				    {
             			SendClientMessage(playerid, COLOR_LIGHTBLUE, "You bought a fishing license for $10,000");
             			GivePlayerCash(playerid, - 10000);
             			PlayerInfo[playerid][pFishLic] = 1;
             			OnPlayerUpdateEx(playerid);
             		}
				}
				else
				{
					SendClientMessage(playerid, COLOR_LIGHTBLUE, " You already own a fishing license");
					return 1;
				}
		   	}
		}
	}


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

Edited by Issey
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
if(!response)

Defapt acea linie, nu e pentru putonul "OK" care este primul, e pentru ultimul buton, in cazul asta "Iesire".

Cand aplici comanda si vrei sa alegi o varianta, apasa pe ESC sau pe butonul "Iesire" sa vezi daca actioneaza cumva. Daca rezultatul este pozitiv, schimba:

if(!response)

In:

if(response)
  • Upvote 1
Link to comment
Share on other sites

  • 0

Micsoreaza numarul dialogului.

In loc de 290198 pune alt numar, mai mic.

Cand zic "mai mic" nu ma refer sa miscorezi numarul cu o cifra/doua. Creeaza alt numar format din 3/4 cifre, care sa nu fie folosit de alte dialoguri.

Edited by #Chase
  • Upvote 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.