23.01.2015, 22:18
new enterCP[MAX_PLAYERS];
PHP код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(!enterCP[playerid])
{
if(checkpointid == h[1])//Enter
{
SetPlayerPos(playerid, 238.727615, 138.634033, 1003.023437);
SetPlayerFacingAngle(playerid, 0);
SetPlayerInterior(playerid, 3);
enterCP[playerid] = true;
}
if(checkpointid == h[2]) //Exit
{
SetPlayerPos(playerid, 2287.032958, 2432.367187, 10.820312);
SetPlayerFacingAngle(playerid, 0);
SetPlayerInterior(playerid, 0);
enterCP[playerid] = true;
}
}
return 1;
}
public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
if(checkpointid == h[1])//Enter
{
enterCP[playerid] = false;
}
if(checkpointid == h[2]) //Exit
{
enterCP[playerid] = false;
}
return 1;
}