16.11.2011, 13:17
Hope it will help.. i really not sure.. but try it.. if I did something wrong.. please someone fix me..
pawn Код:
new gate; // at the start of your script
/* put in public OnGameModeInit() */
gate = CreateObject(976, 821.5, 1734.4000244141, 4.1999998092651, 0, 358, 284);
/* put in public OnPlayerCommandText(playerid, cmdtext[]) */
if(strcmp(cmd, "/opengate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(IsPlayerInRangeOfPoint(i, 5.0, 821.5, 1734.4000244141, 4.1999998092651))
{
MoveObject(gate, 823.29998779297, 1726.3000488281, 4.19999980926510, 3.5);
return 1;
}
}
}
return 1;
}
if(strcmp(cmd, "/closegate", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pLeader] == 7)
{
if(IsPlayerInRangeOfPoint(i, 5.0, 823.29998779297, 1726.3000488281, 4.1999998092651))
{
MoveObject(gate, 821.5, 1734.4000244141, 4.1999998092651, 3.5);
return 1;
}
}
}
return 1;
}