12.01.2016, 19:27
(
Последний раз редактировалось N0FeaR; 12.01.2016 в 21:03.
)
EDIT: Sloved!
When i go near the house is show once the label and then is disappear and then wont show up again
When i go near the house is show once the label and then is disappear and then wont show up again
PHP код:
stock CreateLableText(playerid,lable[],text[])
{
if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) return 1;
new string[128];
if(GetPVarInt(playerid, "LableDraw") > 0)
{
TextDrawSetString(Text:LableDraw[playerid],lable);
format(string, sizeof(string),"~n~~n~%s~n~~n~",text);
return TextDrawSetString(Text:UsedDraw[playerid],string);
}
PlayerPlaySound(playerid,1054, 0.0, 0.0, 0.0);
TextDrawHideForPlayer(playerid,LableDraw[playerid]);
TextDrawShowForPlayer(playerid,LableDraw[playerid]);
TextDrawSetString(Text:LableDraw[playerid],lable);
TextDrawDestroy(UsedDraw[playerid]);
UsedDraw[playerid] = TextDrawCreate(440.000000,173.000000," ");
TextDrawUseBox(UsedDraw[playerid],1);
TextDrawBoxColor(UsedDraw[playerid],0x00000066);
TextDrawTextSize(UsedDraw[playerid],636.000000,308.000000);
TextDrawAlignment(UsedDraw[playerid],0);
TextDrawBackgroundColor(UsedDraw[playerid],0x000000ff);
TextDrawFont(UsedDraw[playerid],2);
TextDrawLetterSize(UsedDraw[playerid],0.300000,1.000000);
TextDrawColor(UsedDraw[playerid],0xffffffff);
TextDrawSetOutline(UsedDraw[playerid],1);
TextDrawSetProportional(UsedDraw[playerid],1);
TextDrawSetShadow(UsedDraw[playerid],1);
TextDrawShowForPlayer(playerid,UsedDraw[playerid]);
format(string, sizeof(string),"~n~~n~%s~n~~n~",text);
TextDrawSetString(Text:UsedDraw[playerid],string);
KillTimer(HideBox[playerid]);
HideBox[playerid] = SetTimerEx("HideTextBox", 1000, false, "i", playerid);
return SetPVarInt(playerid, "LableDraw", 4);
}
PHP код:
}
forward HideTextBox(playerid);
public HideTextBox(playerid)
{
TextDrawHideForPlayer(playerid,LableDraw[playerid]);
TextDrawHideForPlayer(playerid,UsedDraw[playerid]);
return 1;
}
PHP код:
forward OnPlayerPickUpDynamicPickup(playerid, pickupid);
public OnPlayerPickUpDynamicPickup(playerid, pickupid)
{
for(new h = 0; h < sizeof(HouseInfo); h++)
{
if(IsPlayerInRangeOfPoint(playerid,2.0,HouseInfo[h][hExteriorX],HouseInfo[h][hExteriorY],HouseInfo[h][hExteriorZ]))
{
if(GetPlayerVirtualWorld(playerid) == HouseInfo[h][hExtVW])
{
switch(HouseInfo[h][hOwned])
{
case 0:
{
new string[258];
format(string, sizeof(string), " ~r~Property For Sale!~n~ ~g~Value: ~w~$%d~n~ ~g~Level: ~w~%d~n~ ~g~ID: ~w~%d~n~~n~ Type ~g~/house buy.", HouseInfo[h][hValue], HouseInfo[h][hLevel], HouseInfo[h][hSQLId]);
CreateLableText(playerid,"Property",string);
}
case 1:
{
new string[258];
new price[50];
if(HouseInfo[h][hValue] <= 1) price="Donated";
else format(price, 50, "$%d", HouseInfo[h][hValue]);
switch(HouseInfo[h][hRentable])
{
case 0: format(string, sizeof(string), " ~g~Owner: ~w~%s~n~ ~g~Value: ~w~%s", HouseInfo[h][hOwned], price);
case 1: format(string, sizeof(string), " ~g~Owner: ~w~%s~n~ ~g~Rent: ~w~$%d~n~~n~ Type ~g~/house rent ~w~to~n~ rent.", HouseInfo[h][hOwned], HouseInfo[h][hRentFee]);
}
CreateLableText(playerid,"Property",string);