Jump to content

Question

Posted (edited)

Salut, am incercat să fac un shop pe dialog, cum este şi-n gamemode-ul Burned, problema fiind că dacă tastez comanda /shop aceasta nu face nimic şi iţi este trimis mesajul că comanda X nu există.

Imagine (in-game):

 

Precizez şi că gamemode-ul nu dă erori la compilare.

Comanda:

CMD:shop(playerid,params[]) return ShowShop(playerid);

Functia:

function ShowShop(playerid) {
	new diamond = PlayerInfo[playerid][pDiamonds],
		string[180], szDialog[4000];
	strcat(szDialog, "{FFE100}($) Preturi si informatii{FFFFFF}\n");
	if(diamond >= 500) format(string, sizeof(string), "Premium Account - {1ECC14}500 Diamondss\n");
	else format(string, sizeof(string), "Premium account - {FF0000}500 Diamonds\n");
	strcat(szDialog, string);
	new title[180];
	format(title, 256, "Shop: (%d diamonds)", diamond);
	ShowPlayerDialog(playerid, DIALOG_SHOP, DIALOG_STYLE_LIST, title, szDialog, "Select", "Close");
	return 1;
}

 

Edited by Moise05

3 answers to this question

Recommended Posts

  • 0
Posted

Nu ti-as recomanda sa folosesti drept return o functie. Insereaza tot ce se afla in functie in comanda. Apoi, foloseste OnDialogResponse pentru dialogul DIALOG_SHOP.

  • 0
Posted
Acum 39 minute, _alchemy a spus:

Nu ti-as recomanda sa folosesti drept return o functie. Insereaza tot ce se afla in functie in comanda. Apoi, foloseste OnDialogResponse pentru dialogul DIALOG_SHOP.

Am incercat, aceiaşi problemă.

  • 0
Posted
La 18.07.2019 la 23:41, Moise05 a spus:

Am incercat, aceiaşi problemă.

CMD:shop(playerid, params[]) {
	new string[256],
		szDialog[256],
		title[256];
		
	strcat(szDialog, "{FFE100}($) Preturi si informatii{FFFFFF}\n");
	
	if(PlayerInfo[playerid][pDiamonds]) {
		format(string, sizeof(string), "Premium Account - {1ECC14}500 Diamondss\n");
	}
	else {
		format(string, sizeof(string), "Premium account - {FF0000}500 Diamonds\n");
	}
	format(title, sizeof(title), "Shop: (%d diamonds)", PlayerInfo[playerid][pDiamons]);
	ShowPlayerDialog(playerid, DIALOG_SHOP, DIALOG_STYLE_LIST, title, szDialog, "Select", "Close");
	return 1;
}

 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.