[HELP] SetPlayerCheckpoint
#7

Better to use #define for checkpoint IDs, unless you're working on a more dynamic system

pawn Код:
#define CP_NONE 0
#define CP_STORE 1
#define CP_AMMUNATION 2
new CheckPoint[MAX_PLAYERS];
forward UpdateCheckPoint();
public OnGameModeInit()
{
    SetTimer("UpdateCheckPoint",1000,1);
    return 1;
}
public UpdateCheckPoint()
{
    for(new playerid;playerid<MAX_PLAYERS;playerid++)
    {
        if(IsPlayerInRangeOfPoint(playerid,5.0,X,Y,Z))CheckPoint[playerid]=CP_STORE;
        else if(IsPlayerInRangeOfPoint(playerid,5.0,X,Y,Z))CheckPoint[playerid]=CP_AMMUNATION;
        else CheckPoint[playerid]=CP_NONE;
    }
}

public OnPlayerEnterCheckPoint(playerid)
{
    switch(CheckPoint[playerid])
    {
        case CP_NONE: return 1; //Do nothing
        case CP_STORE:
        {
            //Do stuff
        }
        case CP_AMMUNATION:
        {
            //Do stuff
        }
    }
    return 1;
}
Reply


Messages In This Thread
[HELP] SetPlayerCheckpoint - by Larsey123IsMe - 16.01.2011, 21:50
Respuesta: [HELP] SetPlayerCheckpoint - by [M]xFire - 16.01.2011, 21:52
Re: Respuesta: [HELP] SetPlayerCheckpoint - by Larsey123IsMe - 16.01.2011, 21:54
Re: [HELP] SetPlayerCheckpoint - by BlackWolf120 - 16.01.2011, 21:56
Respuesta: [HELP] SetPlayerCheckpoint - by [M]xFire - 16.01.2011, 21:57
Re: [HELP] SetPlayerCheckpoint - by Larsey123IsMe - 16.01.2011, 22:16
Re: [HELP] SetPlayerCheckpoint - by Joe Staff - 16.01.2011, 22:28
Re: [HELP] SetPlayerCheckpoint - by Marricio - 16.01.2011, 23:51
Re: [HELP] SetPlayerCheckpoint - by Larsey123IsMe - 17.01.2011, 00:57

Forum Jump:


Users browsing this thread: 1 Guest(s)