05.03.2009, 18:41
Quote:
|
Originally Posted by [D1zZy_vortex
]
hey guys , i have this in my script : Код:
new cp1[MAX_PLAYERS]; new cp2[MAX_PLAYERS]; cp1[playerid] = SetPlayerCheckpoint(playerid, 1520.5525,-2604.5759,13.5469,3); cp2[playerid] = SetPlayerCheckpoint(playerid, 246.6656,65.0490,1003.6406,3); and when player back and enter cp2 , cp2 must be hidden and player pos must be 1519.7589,-2597.4492,13.5469 please help and thnx |
pawn Код:
cp1 = 0;
cp2 = 0;
pawn Код:
new cp[MAX_PLAYERS];
public OnPlayerSpawn(playerid)
{
SetPlayerCheckpoint(playerid, 1520.5525,-2604.5759,13.5469,3);
cp[playerid] = 0;
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if (cp[playerid])
{
cp[playerid] = 0;
SetPlayerPos(playerid, 1519.7589,-2597.4492,13.5469);
SetPlayerCheckpoint(playerid, 1520.5525,-2604.5759,13.5469,3);
SendClientMessage(playerid, 0xFFFFFFFF, "Teleported!");
}
else
{
cp[playerid] = 1;
SetPlayerPos(playerid, 246.4716,70.0103,1003.6406);
SetPlayerCheckpoint(playerid, 246.6656,65.0490,1003.6406,3);
SendClientMessage(playerid, 0xFFFFFFFF, "Teleported!");
}
return 1;
}
But, the correct checkpoint was there, and you get teleported to the right place.Just add the interior like so:
pawn Код:
SetPlayerInterior(playerid, 5); // change the 5 to the correct interior id
pawn Код:
SetPlayerInterior(playerid, 0);

