Код:
if(strcmp(cmd, "/odoor", true) == 0)
{
if(IsPlayerConnected(playerid))
{
for(new i = 0; i < sizeof(HouseInfo); i++)
{
if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]) || PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
{
if(PlayerInfo[playerid][pDoorkey] == 1)
{
GameTextForPlayer(playerid, "~w~You have opened The door of your house", 5000, 6);
ApplyAnimationEx(playerid,"KISSING","gift_give",4.0,0,0,0,0,0);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW, " You have opened your door ");
return 1;
}
else if(PlayerInfo[playerid][pDoorkey] == 2)
{
GameTextForPlayer(playerid, "~w~You have opened The door of your house", 5000, 6);
ApplyAnimationEx(playerid,"KISSING","gift_give",4.0,0,0,0,0,0);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW, " You have opened your door ");
return 1;
}
else if(PlayerInfo[playerid][pDoorkey] == 3)
{
GameTextForPlayer(playerid, "~w~You have opened The door of your house", 5000, 6);
ApplyAnimationEx(playerid,"KISSING","gift_give",4.0,0,0,0,0,0);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW, " You have opened your door ");
return 1;
}
else if(PlayerInfo[playerid][pDoorkey] == 4)
{
GameTextForPlayer(playerid, "~w~You have opened The door of your house", 5000, 6);
ApplyAnimationEx(playerid,"KISSING","gift_give",4.0,0,0,0,0,0);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW, " You have opened your door ");
}
else if(PlayerInfo[playerid][pDoorkey] == 5)
{
GameTextForPlayer(playerid, "~w~You have opened The door of your house", 5000, 6);
ApplyAnimationEx(playerid,"KISSING","gift_give",4.0,0,0,0,0,0);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW, " You have opened your door ");
}
else if(PlayerInfo[playerid][pDoorkey] == 6)
{
GameTextForPlayer(playerid, "~w~You have opened The door of your house", 5000, 6);
ApplyAnimationEx(playerid,"KISSING","gift_give",4.0,0,0,0,0,0);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW, " You have opened your door ");
}
else if(PlayerInfo[playerid][pDoorkey] == 7)
{
GameTextForPlayer(playerid, "~w~You have opened The door of your house", 5000, 6);
ApplyAnimationEx(playerid,"KISSING","gift_give",4.0,0,0,0,0,0);
PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
SendClientMessage(playerid, COLOR_YELLOW, " You have opened your door ");
}
else
{
GameTextForPlayer(playerid, "~r~You have no Key's to unlock/Lock this door", 5000, 6);
return 1;
}
}
}
}
return 1;
}