12.12.2012, 11:26
Ok here i tried to make a command which shows me the Businesses id and owner of the biz within 2 meters of me but it is not working at all.Codes Below
Help will be appreciated!
Код:
CMD:nearbiz(playerid, params[]) { new idx, string[128]; if(PlayerInfo[playerid][pAdmin] < 1337) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command"); { SendClientMessage(playerid, COLOR_LIGHTGREEN, "* All businesses in the range of 2 meters of you."); new Float:X, Float:Y, Float:Z; new Float:X2, Float:Y2, Float:Z2; GetPlayerPos(playerid, X2, Y2, Z2); for(new i;i<MAX_BIZ;i++) { if(IsPlayerInRangeOfPoint(playerid, 2, BizInfo[idx][bX], BizInfo[idx][bY], BizInfo[idx][bZ])) { new string[128]; format(string, sizeof(string), "Business ID: %d | Owned by: %s", idx, BizInfo[idx][bOwner]); SendClientMessage(playerid, COLOR_WHITE, string); } } } return 1; }