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);
new cp1[MAX_PLAYERS];
new cp2[MAX_PLAYERS];
// Somewhere in script (maybe in command ex. /setcheckpoint)
SetPlayerCheckpoint(playerid, 1520.5525,-2604.5759,13.5469,3);
cp1[playerid] = 1;
public OnPlayerEnterCheckpoint(playerid)
{
if(cp1[playerid] == 1)
{
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, 246.6656,65.0490,1003.6406,3);
SetPlayerPos(playerid, 246.4716,70.0103,1003.6406);
cp2[playerid] = 1;
cp1[playerid] = 0;
}
else if(cp2[playerid] == 1)
{
// Do something
}
public OnPlayerConnect(playerid)
{
[...]
SetPlayerCheckpoint(playerid, 1520.5525,-2604.5759,13.5469,3);
[...]
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
DisablePlayerCheckpoint(playerid);
if (PlayerToPoint(playerid, 5, 1520.5525,-2604.5759,13.5469))
{
SetPlayerPos(playerid, 246.4716,70.0103,1003.6406);
SetPlayerCheckpoint(playerid, 246.6656,65.0490,1003.6406,3);
return 1;
}
if (PlayerToPoint(playerid, 5, 246.6656,65.0490,1003.6406))
{
SetPlayerPos(playerid, 1519.7589,-2597.4492,13.5469);
SetPlayerCheckpoint(playerid, 246.6656,65.0490,1003.6406,3);
return 1;
}
return 1;
}
Originally Posted by Lucas Giovanni
Hey use this Include n' create this:
zueras-server.110mb.com/cpstream.zip (copy and paste in Url). #include <cpstream> new CP_1; new CP_2; //OnGameModeInit CP_1 = CPS_AddCheckpoint(playerid,1520.5525,-2604.5759,13.5469,3.0,20); CP_2 = CPS_AddCheckpoint(playerid,246.6656,65.0490,1003.6 406,3.0,20); //40 is the distance that the player sees the checkpoint on radar (use the "01" does not appear that the). public OnPlayerEnterCheckpoint(playerid) { cp = CPS_GetPlayerCheckpoint(playerid); if(cp == CP_1) { //Function } if(cp == CP_2) { //Function } return 1; } ![]() |
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 |
cp1 = 0;
cp2 = 0;
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;
}
SetPlayerInterior(playerid, 5); // change the 5 to the correct interior id
SetPlayerInterior(playerid, 0);