22.06.2013, 00:17
You could give my include a try for this (it's made for this kind of problem)
https://sampforum.blast.hk/showthread.php?tid=423622
To make things simple follow the instructions but use this stock function to set positions....
SetPlayerPosEx() no need for any range checking, your enter code is now neatly done in it's own function which will reduce clutter and make it easier to update action specific checkpoints/areas.
.................
And could you please make a CP at this pos, just so I understand how you make it:
2127.5300,2380.1204,10.8203
and when you enter it,
Interior ID: 3 Interior X, Y, Z: 964.106994,-53.205497,1001.124572
.................
Sure....
Under Gamemode init
Somewhere else in the script as it's own function
https://sampforum.blast.hk/showthread.php?tid=423622
To make things simple follow the instructions but use this stock function to set positions....
SetPlayerPosEx() no need for any range checking, your enter code is now neatly done in it's own function which will reduce clutter and make it easier to update action specific checkpoints/areas.
pawn Код:
public OnGameModeInit()
{
AddDynamicSphereArea(1000.0, 1000.0, 1000.0, 4.0, "TestArea");
}
OnArea:TestArea(playerid, areaid, areaindex)
{
SetPlayerPosEx(playerid, 0.0, 0.0, 0.0, 0.0, 0, 0);
return 1;
}
pawn Код:
stock SetPlayerPosEx(playerid, Float:x, Float:y, Float:z, Float:fa, vw = 0, interior = 0)
{
SetPlayerPlayer(playerid, x, y, z);
SetPlayerFacingAngle(playerid, fa);
SetPlayerVirtualWorld(playerid, vw);
SetPlayerInterior(playerid, interior);
SetCameraBehindPlayer(playerid);
return 1;
}
And could you please make a CP at this pos, just so I understand how you make it:
2127.5300,2380.1204,10.8203
and when you enter it,
Interior ID: 3 Interior X, Y, Z: 964.106994,-53.205497,1001.124572
.................
Sure....
Under Gamemode init
pawn Код:
AddDynamicCP(964.106994,-53.205497,1001.124572, 2.0, "MyEnterPoint")
pawn Код:
OnCheckPoint:MyEnterPoint(playerid, cpid, cpindex)
{
SetPlayerPosEx(playerid,964.106994,-53.205497,1001.124572, 0.0, 0, 3);
return 1;
}