Setting correct checkpoint from dialog
#1

Hello, I got a business system which you can order cargo for your business.

And when you open cargo deliveries for your business for truckers to bring cargos your business info pops up in this dialog:

But I want to set checkpoint for players when they click the business that they want to deliver the cargo, i used these codes but it only sets the checkpoint to blueberry ( 0.0, 0.0, 0.0 coordinates )


my command to see which businesses accepting cargo
Quote:

CMD:test1(playerid, params[])
{
new count = 0;
new string[512];
for(new i; i < MAX_PLAYERS; i++)
{
if(bInfo[i][bPI] == 1)
{
format(string, sizeof(string), "%s%s %d %d\n", string, bInfo[i][bName], bInfo[i][bPW], bInfo[i][bPM]);
count++;
}
}
Dialog_Show(playerid, KKE, DIALOG_STYLE_LIST, "TEST", string, "TEST", "TEST");
if(count == 0)
{
SendMSG(playerid,"No one accepting product.");
}
return 1;
}

And dialog return

Код:
Dialog:KKE(playerid, response, listitem, inputtext[])
{
	if (response)
	{
	SetPlayerCheckpoint(playerid,bInfo[playerid][iX], bInfo[playerid][iY], bInfo[playeridid][iZ],3.0);
	}
	return 1;
}
How can I make this happen?
Reply
#2

I still need help, I made some changes and now when you use the command dialog pops up and all businesses want cargo shows up, but when you click the first business it says "This business do not accept cargo" even if it does accept cargo.

When you click the second item it shows checkpoint for the first business and when you click third one, it shows checkpoint for second business on the list, so there is some stuff fucked up, anyone know how can I fix this?


Код:
Dialog:KKE(playerid, response, listitem, inputtext[])
{
	if (response)
	{
	    new iyid = listitem;
	    
	    if (bInfo[iyid][bPI] == 0)
	        return ERMSG(playerid, "This business do not accept cargo anymore.");

		SetPlayerCheckpoint(playerid,  bInfo[iyid][bX],bInfo[iyid][bY],bInfo[iyid][bZ],3.0);
	}
	return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)