Stay in CP after pos
#1

Hello,
Can I SetPlayerPos at exit checkpoint ?
I think I can't set the player pos at exit checkpoint while other gamemode can ..
I want something like when player enter entrance checkpoint then the player will spawn in the round of checkpoint. If i'm Set the player pos to exit checkpoint it will be go back to entrance checkpoint and loop each other.



pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
    if(checkpointid == h[1])//Enter
    {
        SetPlayerPos(playerid, 238.727615, 138.634033, 1003.023437);
        SetPlayerFacingAngle(playerid, 0);
        SetPlayerInterior(playerid, 3);
    }

    if(checkpointid == h[2]) //Exit
    {
        SetPlayerPos(playerid, 2287.032958, 2432.367187, 10.820312);
        SetPlayerFacingAngle(playerid, 0);
        SetPlayerInterior(playerid, 0);
    }
    return 1;
}


public OnPlayerLeaveDynamicCP(playerid, checkpointid)
{
    if(checkpointid == h[1])//Enter
    {
       
    }

    if(checkpointid == h[2]) //Exit
    {
       
    }
    return 1;
}

See here what i mean.

Reply
#2

new enterCP[MAX_PLAYERS];

PHP код:
public OnPlayerEnterDynamicCP(playeridcheckpointid)
{
    if(!
enterCP[playerid])
    {
    if(
checkpointid == h[1])//Enter
    
{
        
SetPlayerPos(playerid238.727615138.6340331003.023437);
        
SetPlayerFacingAngle(playerid0);
        
SetPlayerInterior(playerid3);
        
enterCP[playerid] = true;
    }
    if(
checkpointid == h[2]) //Exit
    
{
        
SetPlayerPos(playerid2287.0329582432.36718710.820312);
        
SetPlayerFacingAngle(playerid0);
        
SetPlayerInterior(playerid0);
        
enterCP[playerid] = true;
    }
    }
    return 
1;
}
public 
OnPlayerLeaveDynamicCP(playeridcheckpointid)
{
    if(
checkpointid == h[1])//Enter
    
{
        
enterCP[playerid] = false;
    }
    if(
checkpointid == h[2]) //Exit
    
{
        
enterCP[playerid] = false;
    }
    return 
1;

Reply
#3

It sets me
In a lloop
Reply
#4

Help? I know it's possible, because I just saw it on the picture above?..
Reply
#5

PHP код:
public OnPlayerEnterDynamicCP(playeridcheckpointid)
{
    if(
cpenterable[playerid])
    {
    
SetTimeEx("CPResetTimer"3000"i"playerid);
    
cpenterable[playerid]=false;
    if(
checkpointid == h[1])//Enter
    
{
        
SetPlayerPos(playerid238.727615138.6340331003.023437);
        
SetPlayerFacingAngle(playerid0);
        
SetPlayerInterior(playerid3);
    }
    if(
checkpointid == h[2]) //Exit
    
{
        
SetPlayerPos(playerid2287.0329582432.36718710.820312);
        
SetPlayerFacingAngle(playerid0);
        
SetPlayerInterior(playerid0);
    }
    }
    return 
1;
}
forward CPReset(playerid);
public 
CPReset(playerid)
{
    
cpenterable[playerid]=true;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)