20.09.2012, 14:55
I have a dynamic busines system, but when you do /lockbiz I cannot get it to update the 3DText at there business to show it's closed
CMD:
The second part is just if you own a second business.
+rep if anyone can fix this or help me at all
CMD:
Код:
CMD:lockbiz(playerid, params[]) { if(PlayerInfo[playerid][pPbizkey] != INVALID_BIZ_ID && (IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[PlayerInfo[playerid][pPbizkey]][bExteriorX], BizInfo[PlayerInfo[playerid][pPbizkey]][bExteriorY], BizInfo[PlayerInfo[playerid][pPbizkey]][bExteriorZ]) || IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[PlayerInfo[playerid][pPbizkey]][bInteriorX], BizInfo[PlayerInfo[playerid][pPbizkey]][bInteriorY], BizInfo[PlayerInfo[playerid][pPbizkey]][bInteriorZ]))) { new szMessage[30 + MAX_PLAYER_NAME], string[128]; new b = PlayerInfo[playerid][pPbizkey] || PlayerInfo[playerid][pPbizkey2]; if(BizInfo[PlayerInfo[playerid][pPbizkey]][bLock] == 1) { new biztype[20]; if(BizInfo[b][b247] == 1) { biztype = "24/7 Store"; } if(BizInfo[b][bGunshop] == 1) { biztype = "Gun Store"; } if(BizInfo[b][bClotheshop] == 1) { biztype = "Clothing Store"; } else { biztype = "Open"; } BizInfo[PlayerInfo[playerid][pPbizkey]][bLock] = 0; format(szMessage, sizeof(szMessage), "* %s has unlocked their business.", GetPlayerNameEx(playerid)); ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); format(string, sizeof(string), "Business: %s\n\nOwner: %s\nStatus: Open\n\n{FFFFFF}ID: %d",biztype, BizInfo[b][bOwner],b); UpdateDynamic3DTextLabelText(BizInfo[b][bTextID], COLOR_GREEN, string); } else { new biztype[20]; if(BizInfo[b][b247] == 1) { biztype = "24/7 Store"; } if(BizInfo[b][bGunshop] == 1) { biztype = "Gun Store"; } if(BizInfo[b][bClotheshop] == 1) { biztype = "Clothing Store"; } else { biztype = "Open"; } BizInfo[PlayerInfo[playerid][pPbizkey]][bLock] = 1; format(szMessage, sizeof(szMessage), "* %s has locked their business.", GetPlayerNameEx(playerid)); ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); format(string, sizeof(string), "Business: %s\n\nOwner: %s\nStatus: Closed\n\n{FFFFFF}ID: %d",biztype, BizInfo[b][bOwner], b); UpdateDynamic3DTextLabelText(BizInfo[b][bTextID], COLOR_GREEN, string); } } else if(PlayerInfo[playerid][pPbizkey2] != INVALID_BIZ_ID && (IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[PlayerInfo[playerid][pPbizkey2]][bExteriorX], BizInfo[PlayerInfo[playerid][pPbizkey2]][bExteriorY],BizInfo[PlayerInfo[playerid][pPbizkey2]][bExteriorZ]) || IsPlayerInRangeOfPoint(playerid, 2.0, BizInfo[PlayerInfo[playerid][pPbizkey2]][bInteriorX], BizInfo[PlayerInfo[playerid][pPbizkey2]][bInteriorY], BizInfo[PlayerInfo[playerid][pPbizkey2]][bInteriorZ]))) { new szMessage[30 + MAX_PLAYER_NAME], string[128]; new b = PlayerInfo[playerid][pPbizkey] || PlayerInfo[playerid][pPbizkey2]; if(BizInfo[PlayerInfo[playerid][pPbizkey2]][bLock] == 1) { new lockedinfo[20]; if(BizInfo[b][bLock] == 0) { lockedinfo = "Open"; } if(BizInfo[b][bLock] == 1) { lockedinfo = "Closed"; } else { lockedinfo = "Open"; } new biztype[20]; if(BizInfo[b][b247] == 1) { biztype = "24/7 Store"; } if(BizInfo[b][bGunshop] == 1) { biztype = "Gun Store"; } if(BizInfo[b][bClotheshop] == 1) { biztype = "Clothing Store"; } else { biztype = "Open"; } BizInfo[PlayerInfo[playerid][pPbizkey2]][bLock] = 0; format(szMessage, sizeof(szMessage), "* %s has unlocked their business.", GetPlayerNameEx(playerid)); ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); format(string, sizeof(string), "Business: %s\n\nOwner: %s\nStatus: Open\n\n{FFFFFF}ID: %d",biztype, BizInfo[b][bOwner],b); UpdateDynamic3DTextLabelText(BizInfo[b][bTextID], COLOR_GREEN, string); } else { new lockedinfo[20]; if(BizInfo[b][bLock] == 0) { lockedinfo = "Open"; } if(BizInfo[b][bLock] == 1) { lockedinfo = "Closed"; } else { lockedinfo = "Open"; } new biztype[20]; if(BizInfo[b][b247] == 1) { biztype = "24/7 Store"; } if(BizInfo[b][bGunshop] == 1) { biztype = "Gun Store"; } if(BizInfo[b][bClotheshop] == 1) { biztype = "Clothing Store"; } else { biztype = "Open"; } BizInfo[PlayerInfo[playerid][pPbizkey2]][bLock] = 1; format(szMessage, sizeof(szMessage), "* %s has locked their business.", GetPlayerNameEx(playerid)); ProxDetector(30.0, playerid, szMessage, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); format(string, sizeof(string), "Business: %s\n\nOwner: %s\nStatus: Closed\n\n{FFFFFF}ID: %d",biztype, BizInfo[b][bOwner], b); UpdateDynamic3DTextLabelText(BizInfo[b][bTextID], COLOR_GREEN, string); } } return 1; }
+rep if anyone can fix this or help me at all