08.09.2013, 15:30
So I started scripting for a door to move whenever a player gets next to it, no errors or anything, it's just whenever I go close to them, nothing happens... And one more thing, if you could tell me how to do it for a single player it would highly be appreciated. Thanks a lot.
news
forwards
public OnGameModeInit()
public point(playerid)
public close()
Any help would be highly appreciated.
news
Код:
new g1; new g2; new g3;
Код:
forward point(playerid); forward close();
Код:
public OnGameModeInit()
{
g1 = CreateObject(3037, 935.74127, 2403.97021, 12.20237, 0.00000, 0.00000, -90.00000);
g2 = CreateObject(3037, 958.76367, 2403.97021, 12.18013, 0.00000, 0.00000, -90.00000);
g3 = CreateObject(3037, 981.90692, 2403.97021, 12.24170, 0.00000, 0.00000, -90.00000);
}
Код:
public point(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 935.7413, 2403.9702, 12.2024))
{
MoveObject(g1,935.7413, 2403.9702, 15.6253, 2.50);
}
else
{
MoveObject(g1,935.7413, 2403.9702, 12.2024, 2.50);
}
if(IsPlayerInRangeOfPoint(playerid, 7.0, 958.7637, 2403.9702, 12.1801))
{
MoveObject(g2,958.7637, 2403.9702, 15.6253, 2.50);
}
else
{
MoveObject(g2,958.7637, 2403.9702, 12.1801, 2.50);
}
if(IsPlayerInRangeOfPoint(playerid, 7.0, 981.9069, 2403.9702, 12.2417))
{
MoveObject(g3,981.9069, 2403.9702, 15.6253, 2.50);
}
else
{
MoveObject(g3,981.9069, 2403.9702, 12.2417,2.50);
}
return 1;
}
Код:
public close()
{
MoveObject(g1,935.7413,2403.9702,12.2024,5.00);
MoveObject(g2,958.7637,2403.9702,12.1801,5.00);
MoveObject(g3,1002.1666,2399.7578,12.2417,5.00);
return 1;
}


