26.03.2017, 09:36
Hello Guys i Want Ask About How To Change Dialog
Too Choose Number ?
any one helping me to change dialog to choose with numbers ?
+rep for any one helping me
PHP код:
//------------------------------------------------------------------------------
// House Buying
//------------------------------------------------------------------------------
if(dialogid == HOUSEMENU+4)
{
if(response)
{
new hname[MAX_PLAYER_NAME+9];
if(GetOwnedHouses(playerid) >= MAX_HOUSES_OWNED) { ShowInfoBox(playerid, E_MAX_HOUSES_OWNED, MAX_HOUSES_OWNED, AddS(MAX_HOUSES_OWNED)); return 1; }
if(strcmp(hInfo[h][HouseOwner], pNick(playerid), CASE_SENSETIVE) && strcmp(hInfo[h][HouseOwner], INVALID_HOWNER_NAME, CASE_SENSETIVE)) return ShowInfoBoxEx(playerid, COLOUR_SYSTEM, E_H_ALREADY_OWNED);
if(hInfo[h][HouseValue] > GetPlayerMoney(playerid)) { ShowInfoBox(playerid, E_CANT_AFFORD_HOUSE, hInfo[h][HouseValue], GetPlayerMoney(playerid), (hInfo[h][HouseValue] - GetPlayerMoney(playerid))); return 1; }
else
{
format(hname, sizeof(hname), "%s's House", pNick(playerid));
format(hInfo[h][HouseName], sizeof(hname), "%s", hname);
format(hInfo[h][HouseOwner], MAX_PLAYER_NAME, "%s", pNick(playerid));
hInfo[h][HousePassword] = udb_hash("INVALID_HOUSE_PASSWORD");
hInfo[h][HouseStorage] = 0;
GivePlayerMoney(playerid, -hInfo[h][HouseValue]);
file = INI_Open(filename);
INI_WriteString(file, "HouseOwner", pNick(playerid));
INI_WriteInt(file, "HousePassword", hInfo[h][HousePassword]);
INI_WriteString(file, "HouseName", hname);
INI_WriteInt(file, "HouseStorage", 0);
INI_Close(file);
ShowInfoBox(playerid, I_BUY_HOUSE, hInfo[h][HouseValue]);
foreach(Houses, h2)
{
if(IsHouseInRangeOfHouse(h, h2, RANGE_BETWEEN_HOUSES) && h2 != h)
{
file = INI_Open(HouseFile(h2));
INI_WriteInt(file, "HouseValue", (hInfo[h2][HouseValue] + ReturnProcent(hInfo[h2][HouseValue], HOUSE_SELLING_PROCENT2)));
UpdateHouseText(h2);
INI_Close(file);
}
}
#if GH_USE_MAPICONS == true
DestroyDynamicMapIcon(HouseMIcon[h]);
HouseMIcon[h] = CreateDynamicMapIcon(hInfo[h][CPOutX], hInfo[h][CPOutY], hInfo[h][CPOutZ], 32, -1, hInfo[h][SpawnWorld], hInfo[h][SpawnInterior], -1, MICON_VD);
#endif
UpdateHouseText(h);
}
}
return 1;
}
PHP код:
new ShowMenuHouseText[MAX_PLAYERS];
new Text:HouseBuy1;
PHP код:
HouseBuy1 = TextDrawCreate(9.000000, 165.000000, "1.House Buy");
TextDrawBackgroundColor(HouseBuy1, 255);
TextDrawFont(HouseBuy1, 1);
TextDrawLetterSize(HouseBuy1, 0.310000, 1.100000);
TextDrawColor(HouseBuy1, -16759553);
TextDrawSetOutline(HouseBuy1, 1);
TextDrawSetProportional(HouseBuy1, 1);
PHP код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == HouseBuy)
{
if(!IsPlayerInAnyVehicle(playerid))
{
//Code To Showing Textdraw + Menu Choose
}
}
return 1;
}
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
if(checkpointid == HouseBuy)
{
if(!IsPlayerInAnyVehicle(playerid))
{
//Code To Hide Textdraw + Menu Choose
}
}
return 1;
}
PHP код:
HouseBuy(playerid)
{
TextDrawShowForPlayer(playerid, HouseBuy);
}
HideHouseBuy(playerid)
{
TextDrawHideForPlayer(playerid, HouseBuy);
PHP код:
public OnPlayerText(playerid, text[])
{
if(text[0] == '1')
{
if(ShowMenuHouseText[playerid] == 1)
{
//should be here Buy house Script
}
}
return 0;
}
+rep for any one helping me