ok first you need to put this under your defines
then under OnGameModeInit
pawn Код:
gatenamehere = CreateObject(11102, 1208.1774902344, -1475.3129882813, 18.008708953857, 0, 0, 0);
pawn Код:
if(strcmp(cmdtext,"/opengate", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 15, 1208.1774902344, -1475.3129882813, 18.008708953857))
{
MoveObject(gatenamehere, 1208.1774902344, -1475.3129882813, 18.008708953857, 15);//how fast it moves is speed
return 1;
}
}
if(strcmp(cmdtext,"/closegate", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 15, 1208.1774902344, -1475.3129882813, 18.008708953857))
{
MoveObject(gatenamehere, 1208.1774902344, -1475.3129882813, 18.008708953857, 0, 0, 0, 15);
}
return 1;
}
CreateObject(11102, 1208.1774902344, -1475.3129882813, 18.008708953857, 0, 0, 0);//opened gate
CreateObject(11102, 1208.1774902344, -1475.3129882813, 14.548282623291, 0, 0, 0);//closed gate