18.08.2017, 10:13
try this
Код:
CMD:knock(playerid, params[]) { new string[50], NearHouse; for(new idx; idx < MAX_HOUSES; idx++) { if(IsPlayerInRangeOfPoint(playerid, 4.0, HouseInfo[idx][hX], HouseInfo[idx][hY], HouseInfo[idx][hZ])) { NearHouse=1; format(string, sizeof(string), "* %s knocks on the house door.", RPN(playerid)); SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) { if(HouseInfo[idx][hLevel] == 1 && IsPlayerInRangeOfPoint(i, 8, 243.9951,304.9418,999.1484)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 2 && IsPlayerInRangeOfPoint(i, 8, 2259.6702,-1135.8542,1050.6328)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 3 && IsPlayerInRangeOfPoint(i, 8, 2308.8254,-1212.8070,1049.0234)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 4 && IsPlayerInRangeOfPoint(i, 8, 260.7436,1237.5563,1084.2578)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 5 && IsPlayerInRangeOfPoint(i, 8, -42.5742,1405.6521,1084.4297)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 6 && IsPlayerInRangeOfPoint(i, 8, 2203.3323,-1250.0913,1529.1060)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 7 && IsPlayerInRangeOfPoint(i, 8, 2365.2183,-1135.4014,1050.8750)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 8 && IsPlayerInRangeOfPoint(i, 8, 2270.1270,-1210.4855,1047.5625)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 9 && IsPlayerInRangeOfPoint(i, 8, 2324.4424,-1149.2057,1050.7101)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 10 && IsPlayerInRangeOfPoint(i, 8, 83.0863,1322.3020,1083.8662)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 11 && IsPlayerInRangeOfPoint(i, 8, 1260.6544,-785.6682,1091.9063)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 12 && IsPlayerInRangeOfPoint(i, 8, 852.0531,1997.6768,1011.0809)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } if(HouseInfo[idx][hLevel] == 13 && IsPlayerInRangeOfPoint(i, 8, -1821.3711,802.0818,128.2039)) { format(string, sizeof(string), "* someone knocks on the door."); SendNearbyMessage(i, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE); } } } else { NearHouse=0; SendClientMessage(playerid, COLOR_WHITE, "You are not near a house."); return 1; } } return 1; }