23.05.2014, 16:39
how to make an auto opening of the gate! for example machine pojehali to the gate, the gate opened by themselves automatically!
https://sampforum.blast.hk/showthread.php?tid=278880 Read this tutorial will help you, next time search for what you are looking for in tutorial section before posting!
|
#define GATE_OBJ 8 // Edit, it is obviously not that
new Float:gates[][3] =
{
{0.0, 0.0, 0.0},
{0.1, 0.1, 1.0},
// add gates or edit mines as much as you want
};
new gatesObj[sizeof(gates)] =
{
GATE_OBJ,
GATE_OBJ,
}
public OnPlayerUpdate(playerid)
{
for(new i = 0; i < sizeof(gates); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, gates[i][0], gates[i][1], gates[i][2]))
{
MoveObject(gatesObj[i], 0.1, 0.1, 1.0, 0.05);
}
}
return 1;
}
#define GATE_OBJ 8 // Edit, it is obviously not that
new Float:gates[][3] =
{
{0.0, 0.0, 0.0},
{0.1, 0.1, 1.0},
// add gates or edit mines as much as you want // THIS THIS THIS
};
new gatesObj[sizeof(gates)] =
{
GATE_OBJ,
GATE_OBJ,
}
public OnPlayerUpdate(playerid)
{
for(new i = 0; i < sizeof(gates); i++)
{
if(IsPlayerInRangeOfPoint(playerid, 3.0, gates[i][0], gates[i][1], gates[i][2]))
{
MoveObject(gatesObj[i], 0.1, 0.1, 1.0, 0.05);
}
}
return 1;
}