cmd:buy
#1

Hello I have buy cmd

Firstly, I check if player in or at biz

Код:
    new bizid = BizEntered[playerid];
    new bizon = IsPlayerAtBiz(playerid);
    if(bizid == -1&&bizon == -1) return SendClientMessage(playerid, COLOR_ERROR, "You are not inside/at any business!");
Then I want when you type buy, it would show you different dialogs based on businesses types, how it should look like.

I made it like that:
Код:
if(bizInfo[bizid][Type] == 1)
{
show dialog
}
else if(bizInfo[bizon][Type] == 2)
{
show dialog
}
but it gives me unknown command error
Reply
#2

Can't you give us the whole CMD:buy to work on? It's close to impossible for us to see the error just from this.
Reply
#3

Код:
CMD:buy(playerid, params[])
{
	new string[256];
    new bizid = BizEntered[playerid];
    new bizon = IsPlayerAtBiz(playerid);
    if(bizid == -1&&bizon == -1) return SendClientMessage(playerid, COLOR_ERROR, "You are not inside/at any business!");
	if(bizInfo[bizid][Type] == 2 || bizInfo[bizid][Type] == 3)
	{
	if(bizInfo[bizid][Components] == 0) return GameTextForPlayer(playerid, "~r~OUT OF STOCK", 2000, 6);
	ShowPlayerDialog(playerid, DIALOG_AMMUNITION, DIALOG_STYLE_LIST, "Ammunition shop", "Deagle\nColt\nM4\nAK47\nSniper\nSawn-off shotgun\nArmour", "Buy", "Close");
	}
	else if(bizInfo[bizid][Type] == 0)
	{
	if(bizInfo[bizid][Components] == 0) return GameTextForPlayer(playerid, "~r~OUT OF STOCK", 2000, 6);
	format(string,sizeof(string), "Phone - $%s\nRadio - $%s\nLaptop - $%s", FormatNumber(bizInfo[bizid][PhonePrice]), FormatNumber(bizInfo[bizid][RadioPrice]), FormatNumber(bizInfo[bizid][LaptopPrice]));
	ShowPlayerDialog(playerid, DIALOG_24SHOP, DIALOG_STYLE_LIST, "24/7 store", string, "Buy", "Close");
	}
	if(bizInfo[bizon][Type] == 13)
	{
	ShowPlayerDialog(playerid, DIALOG_LUXURYDS, DIALOG_STYLE_LIST, "Dealership:", "Stretch - $6,500,000\nInfernus - $5,500,000\nTurismo - $4,500,000\nSuper GT - $4,100,000\nBullet - $5,500,000\nSultan - $3,200,000\nElegy - $3,200,000\nPheonix - $3,000,000\nBuffalo - $2,800,000\nBanshee - $2,700,000\nZR-350 - $3,000,000\nComet - $3,500,000\nSlamvan - $2,500,000\nJester - $2,900,000\nStratum - $2,400,000\nFlash - $2,500,000\nEuros - $2,300,000\nAlpha - $2,200,000", "Buy", "Close");
	}
	else if(bizInfo[bizon][Type] == 14)
	{
	ShowPlayerDialog(playerid, DIALOG_HEAVYDS, DIALOG_STYLE_LIST, "Dealership:", "Linerunner - $2,000,000\nMule - $800,000\nPacker - $1,100,000\nYankee - $900,000\nBoxville - $900,000\nBenson - $850,000\nTanker - $2,000,000\nRoadtrain - $2,000,000\nDFT-30 - $1,800,000", "Buy", "Close");
	}
	else if(bizInfo[bizon][Type] == 17)
	{
	ShowPlayerDialog(playerid, DIALOG_BIKESDS, DIALOG_STYLE_LIST, "Dealership:", "PCJ-600 - $2,500,000\nFaggio - $80,000\nFreeway - $1,800,000\nSanchez - $2,100,000\nFCR-900 - $2,400,000\nBF-400 - $2,350,000\nWayfarer - $1,800,000", "Buy", "Close");
	}
	else if(bizInfo[bizon][Type] == 18)
	{
	ShowPlayerDialog(playerid, DIALOG_GENERALDS, DIALOG_STYLE_LIST, "Dealership:", "Bobcat - $200,000\nPrevion - $180,000\nSolair - $210,000\nHermes - $400,000\nSabre - $550,000\nRegina - $350,000\nVirgo - $250,000\nCamper - $500,000\nFortune - $350,000\nCadrona - $120,000\nWillard - $130,000\nBlade - $700,000\nSadler - $280,000\nPrimo - $140,000\nTampa - $90,000\nTahoma - $130,000\nSavanna - $650,000\nEmperor - $350,000\nSunrise - $650,000\nVincent - $700,000\nTornado - $600,000", "Buy", "Close");
	}
	else if(bizInfo[bizon][Type] == 19)
	{
	ShowPlayerDialog(playerid, DIALOG_GENERALDS1, DIALOG_STYLE_LIST, "Dealership:", "Landstalker - $3,000,000\nSentinel - $2,600,000\nMoonbeam - $1,000,000\nWashington - $1,700,000\nPremier - $1,600,000\nStallion - $1,200,000\nAdmiral - $1,400,000\nOceanic - $1,100,000\nBurrito - $2,100,000\nRancher - $2,200,000\nBlista Compact - $1,500,000\nElegant - $1,700,000\nFeltzer - $2,000,000\nWindsor - $2,300,000\nUranus - $2,00,000\nHuntley - $3,200,000\nStafford - $2,300,000\nClub - $1,650,000", "Buy", "Close");
	}
	else if(bizInfo[bizon][Type] == 20)
	{
	ShowPlayerDialog(playerid, DIALOG_PLANESDS, DIALOG_STYLE_LIST, "Dealership:", "Skimmer - $2,700,000\nSparrow - $5,500,000\nMaverick - $5,500,000\nBeagle - $4,000,000\nStuntplane - $3,600,000\nShamal - $7,000,000\nDodo - $3,500,000", "Buy", "Close");
	}
	else if(bizInfo[bizon][Type] == 21)
	{
	ShowPlayerDialog(playerid, DIALOG_BOATSDS, DIALOG_STYLE_LIST, "Dealership:", "Squallo - $3,700,000\nSpeeder - $3,500,000\nTropic - $3,500,000\nDinghy - $150,000\nMarquis - $2,000,000\nJetmax - $3,600,000", "Buy", "Close");
	}
	return 1;
}
Reply
#4

Somebody?

P.S: Sorry for double, but wanted to renew
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)