18.06.2018, 11:06
Hello everyone there is a bug on this script wich is doesn't update the text it just keep "Opened" even when i lock the biz this is
And the lock cmd
PHP код:
ReloadBusiness(businessid)
{
if(BusinessInfo[businessid][bExists])
{
new
string[128];
DestroyDynamic3DTextLabel(BusinessInfo[businessid][bText]);
DestroyDynamicPickup(BusinessInfo[businessid][bPickup]);
DestroyDynamicMapIcon(BusinessInfo[businessid][bMapIcon]);
if(BusinessInfo[businessid][bOwnerID] == 0)
{
format(string, sizeof(string), "[Business]\nPrice: %s\nType: %s\nEntry Fee: $%i\nStatus: %s", FormatNumber(BusinessInfo[businessid][bPrice]), bizInteriors[BusinessInfo[businessid][bType]][intType], BusinessInfo[businessid][bEntryFee], (BusinessInfo[businessid][bLocked]) ? ("{ffff00}Closed") : ("{00AA00}Opened"));
}
else
{
format(string, sizeof(string), "[Business]\nOwner: %s\nType: %s\nEntry Fee: $%i\nStatus: %s", BusinessInfo[businessid][bOwner], bizInteriors[BusinessInfo[businessid][bType]][intType], BusinessInfo[businessid][bEntryFee], (BusinessInfo[businessid][bLocked]) ? ("{FFFF00}Closed") : ("{00AA00}Opened"));
}
BusinessInfo[businessid][bText] = CreateDynamic3DTextLabel(string, COLOR_GREY1, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ] + 0.1, 10.0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt]);
BusinessInfo[businessid][bPickup] = CreateDynamicPickup(1272, 1, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt]);
switch(BusinessInfo[businessid][bType])
{
case BUSINESS_STORE: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 17, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL);
case BUSINESS_GUNSHOP: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 6, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL);
case BUSINESS_CLOTHES: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 45, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL);
case BUSINESS_RESTAURANT: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 10, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL);
case BUSINESS_GYM: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 54, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL);
case BUSINESS_AGENCY: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 58, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL);
case BUSINESS_BARCLUB: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 49, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL);
}
}
}
PHP код:
else if((id = GetNearbyBusinessEx(playerid)) >= 0 && IsBusinessOwner(playerid, id))
{
new businessid;
if(!BusinessInfo[id][bLocked])
{
BusinessInfo[id][bLocked] = 1;
GameTextForPlayer(playerid, "~r~Business locked", 3000, 6);
SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s locks their business door.", GetPlayerRPName(playerid));
}
else
{
BusinessInfo[id][bLocked] = 0;
GameTextForPlayer(playerid, "~g~Business unlocked", 3000, 6);
SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s unlocks their business door.", GetPlayerRPName(playerid));
}
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
ReloadBusiness(businessid);
mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET locked = %i WHERE id = %i", BusinessInfo[id][bLocked], BusinessInfo[id][bID]);
mysql_tquery(connectionID, queryBuffer);
return 1;
}