if(strcmp(cmd, "/openhouse", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(Houses); i++)
{
if (PlayerToPoint(3.0, playerid,Houses[i][EnterX], Houses[i][EnterY], Houses[i][EnterZ]) || PlayerToPoint(3.0, playerid,Houses[i][ExitX], Houses[i][ExitY], Houses[i][ExitZ]))
{
if(PlayerInfo[playerid][pHouseKey] == i)
{
if(Houses[i][Locked] == 1)
{
Houses[i][Locked] = 0;
SendClientMessage(playerid, COLOR_LIGHTYELLOW2,"[INFO:] Durvis Atvērtas.");
PlayerActionMessage(playerid,15.0,"izvelk atslēgu no kabatas un atslēdz durvis.");
SaveHouses();
return 1;
}
if(Houses[i][Locked] == 0)
{
Houses[i][Locked] = 1;
SendClientMessage(playerid, COLOR_LIGHTYELLOW2,"[INFO:] Durvis Aizslēgtas.");
PlayerActionMessage(playerid,15.0,"izvelk atslēgu no kabatas un aizslēdz durvis.");
SaveHouses();
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2,"[ERROR:] Tev nav atslēgas љai mājai!");
return 1;
}
}
}
}
return 1;
}
|
Originally Posted by _Xerxes_
Ask in this scripts topic.
|
