Detect House ID from Dialog[How to improve code optimization]
#4

Код:
new str[256], buff[10], id = 1, c = 0;
foreach(new i: HouseKey[playerid])
{
	format(buff, sizeof(buff), "Key_%d", c);
	SetPVarInt(playerid, buff, id);
	
	format(str,sizeof(str),"%s[%d]\n",str,id);
	id++;
	c++;
}
ShowPlayerDialog(playerid,DIALOG_HOUSE_LIST,DIALOG_STYLE_LIST,"Select House",str,"OK","");
Код:
case DIALOG_HOUSE_LIST:
{
	if(response == 1)
	{
		new buff[10], id;
		format(buff, sizeof(buff), "Key_%d", listitem);
		id = GetPVarInt(playerid, buff);
		printf("Player is click on ID : %i", id);
	}
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)