27.10.2010, 19:26
pawn Код:
if(dialogid == 20)
{
if(response == 1)
{
for(new h = 0; h < MAX_HOUSES; h++)
{
if(listitem == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
{
HouseInfo[h][hLocked] = 1;
SendClientMessage(playerid, COLOR_RED, "You locked your house.");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[h][hExitx], HouseInfo[h][hExity], HouseInfo[h][hExitz]))
{
HouseInfo[h][hLocked] = 1;
SendClientMessage(playerid, COLOR_RED, "You locked your house.");
return 1;
}
}
if(listitem == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]))
{
HouseInfo[h][hLocked] = 0;
SendClientMessage(playerid, COLOR_RED, "You unlocked your house.");
return 1;
}
if(IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[h][hExitx], HouseInfo[h][hExity], HouseInfo[h][hExitz]))
{
HouseInfo[h][hLocked] = 0;
SendClientMessage(playerid, COLOR_RED, "You unlocked your house.");
return 1;
}
}
}
}
return 1;
}