pawn Код:
if(strcmp(cmd, "/opendoor", true) == 0 || strcmp(cmd, "/od", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid) || IsASheriff(playerid))
{
if(PlayerToPoint(2, playerid,239.649917,117.577560,1003.218688) && IsACop(playerid))
{
MoveObject(pdd1, 239.5, 120.09999847412, 1003.4000244141,1); // V
}
else if(PlayerToPoint(2, playerid,253.191696,109.082427,1003.225708))
{
MoveObject(pdd2, 253, 111.19999694824, 1003.4000244141,1);
}
else if(PlayerToPoint(2, playerid,253.207733,125.242126,1003.218750))
{
MoveObject(pdd3, 253, 123.30000305176, 1003.4000244141,1); //V
}
else if(PlayerToPoint(2, playerid,232.931304,109.093315,1010.208679) && IsACop(playerid))//d.chief
{
if(PlayerInfo[playerid][pRank] >= 9)
{
MoveObject(pdddc, 232.69999694824, 111.19999694824, 1010.700012207,1);
}
else
{
SendClientMessage(playerid, COLOR_DARKRED, "Access Deny!");
return 1;
}
}
else if(PlayerToPoint(2, playerid, 231.135330,119.553451,1010.218750) && IsACop(playerid))//chief
{
if(PlayerInfo[playerid][pRank] >= 9)
{
MoveObject(pddc,229.10000610352, 119.40000152588, 1010.5999755859,1);
}
else
{
SendClientMessage(playerid, COLOR_DARKRED, "Access Deny!");
return 1;
}
}
else if(PlayerToPoint(2, playerid,275.642517,117.420158,1004.617187) && IsACop(playerid))
{
MoveObject(pdd4, 275.542517,119.420158,1004.617187,1);
}
else if(PlayerToPoint(2, playerid,265.835815,112.502014,1004.617187) && IsACop(playerid))
{
MoveObject(pdd5, 263.70001220703, 112.69999694824, 1004.799987793,1);
}
else if(PlayerToPoint(2, playerid,265.989532,115.889060,1004.617187) && IsACop(playerid))
{
MoveObject(pdd6, 268.20001220703, 116.09999847412, 1004.799987793,1);
}
else if(PlayerToPoint(2, playerid,239.628219,125.069351,1003.218750) && IsACop(playerid))
{
MoveObject(pdd7, 239.80000305176, 122.90000152588, 1003.4000244141,1);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "you are not near any door!");
return 1;
}
format(string, sizeof(string), "* %s types the access code **** while covering with his free hand.", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else {SendClientMessage(playerid, COLOR_GREY, " You are not a Cop!");}
}
return 1;
}
if(strcmp(cmd, "/closedoor", true) == 0 || strcmp(cmd, "/cd", true) ==0)
{
if(IsPlayerConnected(playerid))
{
if(IsACop(playerid) || IsASheriff(playerid))
{
if(PlayerToPoint(2, playerid,239.5, 117.59999847412, 1003.4000244141))
{
MoveObject(pdd1, 239.5, 117.59999847412, 1003.4000244141,1);
}
else if(PlayerToPoint(2, playerid,253.19999694824, 109.09999847412, 1003.4000244141))
{
MoveObject(pdd2, 253.19999694824, 109.09999847412, 1003.4000244141,1);
}
else if(PlayerToPoint(2, playerid,253.30000305176, 125.30000305176, 1003.4000244141))
{
MoveObject(pdd3, 253.30000305176, 125.30000305176, 1003.4000244141,1);
}
else if(PlayerToPoint(2, playerid,232.80000305176, 109.09999847412, 1010.4000244141))//d.chief
{
MoveObject(pdddc, 232.80000305176, 109.09999847412, 1010.4000244141,1);
}
else if(PlayerToPoint(2, playerid,231.10000610352, 119.59999847412, 1010.4000244141))//chief
{
MoveObject(pddc, 231.10000610352, 119.59999847412, 1010.4000244141,1);
}
else if(PlayerToPoint(2, playerid,217.80000305176, 116.5, 999.20001220703))
{
MoveObject(pdd4, 217.80000305176, 116.5, 999.20001220703,1);
}
else if(PlayerToPoint(2, playerid,265.70001220703, 112.40000152588, 1004.799987793))
{
MoveObject(pdd5, 265.70001220703, 112.40000152588, 1004.799987793,1);
}
else if(PlayerToPoint(2, playerid,266, 115.90000152588, 1004.799987793))
{
MoveObject(pdd6, 266, 115.90000152588, 1004.799987793,1);
}
else if(PlayerToPoint(2, playerid,239.60000610352, 125.09999847412, 1003.4000244141))
{
MoveObject(pdd7, 239.60000610352, 125.09999847412, 1003.4000244141,1);
}
else
{
SendClientMessage(playerid, COLOR_GREY, "you are not near any door!");
return 1;
}
format(string, sizeof(string), "* %s closes the door", sendername);
ProxDetector(15.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else {SendClientMessage(playerid, COLOR_GREY, " You are not a Cop!");}
}
return 1;
}