06.04.2015, 22:05
Ok. You have a continuous loop. Use break to stop it once you have an avaliable house. I.e:
and from the debugs you have provided, there is something wrong with strmatch. So lets replace it with strcmp for a quick test.
Код:
CMD:lockgarage(playerid, params[]) { new string[128]; for(new i = 0; i< sizeof(GarageInfo); i++) { print("1"); if(IsPlayerInRangeOfPoint(playerid, 5, GarageInfo[i][gExteriorX], GarageInfo[i][gExteriorY], GarageInfo[i][gExteriorZ]) || IsPlayerInRangeOfPoint(playerid, 5, 1860.0675,-2347.2207,-37.4430)) { print("2"); if(!strcmp(HouseInfo[GarageInfo[i][gHouseID]][hOwner],GetPlayerNameEx(playerid))) { print("3"); if(!GarageInfo[i][gLock]) { GarageInfo[i][gLock] = 1; format(string, sizeof(string), "* %s unlocks their garage.", RPN(playerid)); ProxDetector(15.0, playerid, string, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME); GText(playerid, "~g~Garage Unlocked", 3500, 3); print("4"); } else if(GarageInfo[i][gLock]) { GarageInfo[i][gLock] = 0; format(string, sizeof(string), "* %s locks their garage", RPN(playerid)); ProxDetector(15.0, playerid, string, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME, COLOR_ACCIONME); GText(playerid, "~r~Garage Locked", 3500, 3); print("5"); } SaveGarages(i); print("6"); } // so on and forth. break; } } return 1; }