Jump to content
  • 0

Ajutor la dialog


eXtreMe96

Question

Sallut am facut ca cind intri in pickup sati apara dialog unde iti spune vrei sa cumperi casa da sau nu. Deci asta mi e clar dar cum pot face ca atunci cind casa deja este cumparata sa numi apara acel dialog folosesc sistemul lui Antironix va rog numi propuneti alte house system dar raspundeti la intrebare

lol

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

Am gasit

if (dini_Int(str1, "Houseid")!=-255)
{
    ShowPlayerDialog(playerid,825,DIALOG_STYLE_MSGBOX,"House:","Doresti sa cumperi aceasta casa?","Da","Nu");
}
else
{
ShowPlayerDialog(playerid,825,DIALOG_STYLE_MSGBOX,"House:","Test","Da","Nu");
}

Da oricum daca casa este cumparata numi apare test dar imi apare daca doresc sa o cumpar care ar fi greseala?

lol

Link to comment
Share on other sites

Ala este pentru ID casa, n-are legatura, baga si daca e cumparata in aia, exemplu:

if (dini_Int(str1, "Houseid")!=-255 && hInfo[ houseid ][ Bought ] == 0 )
{
    ShowPlayerDialog(playerid,825,DIALOG_STYLE_MSGBOX,"House:","Doresti sa cumperi aceasta casa?","Da","Nu");
}
else if( hInfo[ houseid ][ Bought ] == 1 )
{
    ShowPlayerDialog(playerid,825,DIALOG_STYLE_MSGBOX,"House:","Test","Da","Nu");
}

Link to comment
Share on other sites

Am incercat toate variabilile din comanda sell si buy se la pun nu merg uite postez aicea comenzile buy si sell poate tu gasesti variabilie ((sunt disperat

 dcmd_buy(playerid,params[])
{
    #pragma unused params
	new str[255],str1[255],pname[24], housenumber;
	housenumber = GetHouseID(playerid);
	if(housenumber == -1) return SendClientMessage(playerid, c_r, "You are not in a house icon!");

	GetPlayerName(playerid, pname, 24);
	format(str1, sizeof(str1), "Houses/Users/%s", udb_encode(pname));
	if(dini_Exists(str1))
	{
		if (dini_Int(str1, "Houseid")!=-255) return SendClientMessage(playerid, c_r, "You can only buy one house!");
	}
	format(str1, sizeof(str1), "Houses/houseid%d", housenumber);
	if (strcmp(hInfo[housenumber][Name],"ForSale",true)) return SendClientMessage(playerid, c_r, "This house isn't for sale!");
	if(GetPlayerScore(playerid)<hInfo[housenumber][Cost]) return SendClientMessage(playerid, c_r, "{FFF1AF}Nu ai {00C0FF}scor {FFAF00}destul!");
	SendClientMessage(playerid, c_y, "You have bought the house!");
	format(str, sizeof(str), "%s has bought houseid 0",pname);
	print(str);
	SetPlayerScore(playerid,GetPlayerScore(playerid)-hInfo[housenumber][Cost]);
    dini_Set(str1, "Name", pname);
    hInfo[housenumber][Name]=pname;
    hInfo[housenumber][Locked] = dini_IntSet(str1,"Locked",0);

	format(str1, sizeof(str1), "Houses/Users/%s", udb_encode(pname));
	if (!dini_Exists(str1)) dini_Create(str1);
	new Float:sy, Float:sx, Float:sz;
	dini_IntSet(str1, "Houseid", housenumber);
	if(!dini_Isset(str1,"Rentid"))
	{
		dini_IntSet(str1, "Rentid", -255);
	}
	GetPlayerPos(playerid, sx,sy,sz);
	dini_FloatSet(str1, "SpawnX", sx);
	dini_FloatSet(str1, "SpawnY", sy);
	dini_FloatSet(str1, "SpawnZ", sz);
	dini_IntSet(str1, "SpawnInt", GetPlayerInterior(playerid));
	DestroyPickup(HousePickup[housenumber]);
	HousePickup[housenumber] = CreatePickup(1277, 23, hInfo[housenumber][iconx], hInfo[housenumber][icony], hInfo[housenumber][iconz]);
	GetPlayerName(playerid, pname, 24);
	format(str1, sizeof(str1), "Houses/Users/%s", udb_encode(pname));
	if(!dini_Exists(str1)) return SendClientMessage(playerid, c_r, "You don't own a house!");
	if(dini_Int(str1, "Houseid")!=-255)
	{
	    housemapicon[playerid] = SetPlayerMapIcon(playerid,32,hInfo[dini_Int(str1, "Houseid")][iconx], hInfo[dini_Int(str1, "Houseid")][icony], hInfo[dini_Int(str1, "Houseid")][iconz],31,c_y);
	}
	else if (dini_Int(str1, "Rentid")!=-255)
	{
	    housemapicon[playerid] = SetPlayerMapIcon(playerid,32,hInfo[dini_Int(str1, "Rentid")][iconx], hInfo[dini_Int(str1, "Rentid")][icony], hInfo[dini_Int(str1, "Rentid")][iconz],31,c_y);
	}
	return 1;
}


dcmd_sell(playerid,params[])
{
	#pragma unused params
	new str[255],str1[256],pname[24],housenumber;
	housenumber = GetHouseID(playerid);
	GetPlayerName(playerid, pname, 24);
	format(str1, sizeof(str1), "Houses/houseid%d", housenumber);
	if (strcmp(hInfo[housenumber][Name],pname,false)) return SendClientMessage(playerid, c_r, "{FFF1AF}Acesta casa {00C0FF}nuti apratine {FFAF00}Lol!");
 	SendClientMessage(playerid, c_y, "{FFF1AF}Ti-ai {00C0FF}vindut {FFAF00}casa!");
  	format(str, sizeof(str), "%s has sold houseid 0",pname);
	print(str);
	GivePlayerMoney(playerid, hInfo[housenumber][Sell]);
    dini_Set(str1, "Name", "ForSale");
    hInfo[housenumber][Locked] = dini_IntSet(str1,"Locked",1);
    format(hInfo[housenumber][Name],255,"ForSale");
	format(str1, sizeof(str1), "Houses/Users/%s", udb_encode(pname));
	if (!dini_Exists(str1)) dini_Create(str1);
	dini_IntSet(str1, "Houseid", -255);
	DestroyPickup(HousePickup[housenumber]);
	HousePickup[housenumber] = CreatePickup(1559, 23, hInfo[housenumber][iconx], hInfo[housenumber][icony], hInfo[housenumber][iconz]);
	RemovePlayerMapIcon(playerid, housemapicon[playerid]);
	RemovePlayerMapIcon( playerid, housemapicon[playerid] );

 	return 1;
}

lol

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.