Checkpoint adding ! REP +1 !!
#3

Here you have I explained all line by line in comments....

pawn Код:
new PlayerChecPoint[MAX_PLAYERS];//this will help us , you will see below
    if (strcmp("/work", cmdtext, true, 10) == 0)
    {
        PlayerChecPoint[playerid] = 1;//this will help us OnPlayerEnterChecpoint , you will see
        SetPlayerCheckpoint(playerid,595.3140,875.2714,-43.3098,5.0);
        //parameters are   (idofplayer,PositionX,positionY,positionZ,sazeof checkponit);
        return 1;
    }
        if (strcmp("/work1", cmdtext, true, 10) == 0)
    {
        PlayerChecPoint[playerid] = 2;//this will help us OnPlayerEnterChecpoint , you will see
        SetPlayerCheckpoint(playerid,594.3141,875.2714,-43.3098,5.0);
        //parameters are   (idofplayer,PositionX,positionY,positionZ,sazeof checkponit);
        return 1;
    }
    return 0;
}

public OnPlayerEnterCheckpoint(playerid)
{
    //PlayerCheckpoint[playerid] helps as there is no checkpoint id to specify in which checkpoint player enters
    if(PlayerCheckpoint[playerid] == 1)
    {//so this helps us which checkpoint it is
        SendClientMessage(playerid,-1,"This is Checkpoint number one.");
        //so I think you should want here to disablethischecpoint
        DisablePlayerCheckpoint(playerid);//disable current checkpoint
        //other codes here
    }
    if(PlayerCheckpoint[playerid] == 2)
    {//so this helps us which checkpoint it is
        SendClientMessage(playerid,-1,"This is Checkpoint number two.");
        //so I think you should want here to disablethischecpoint
        DisablePlayerCheckpoint(playerid);//disable current checkpoint
        //other codes here
    }
    return 1;
}
Reply


Messages In This Thread
Checkpoint adding ! REP +1 !! - by Avi57 - 31.03.2012, 04:34
Re: Checkpoint adding ! REP +1 !! - by Avi57 - 31.03.2012, 05:15
Re: Checkpoint adding ! REP +1 !! - by Shabi RoxX - 31.03.2012, 05:33
Respuesta: Checkpoint adding ! REP +1 !! - by Chris1337 - 31.03.2012, 05:35
Re: Checkpoint adding ! REP +1 !! - by captainjohn - 31.03.2012, 05:55
Re: Checkpoint adding ! REP +1 !! - by Avi57 - 31.03.2012, 06:51
Re: Checkpoint adding ! REP +1 !! - by Avi57 - 31.03.2012, 07:02
Re: Checkpoint adding ! REP +1 !! - by captainjohn - 31.03.2012, 07:12
Re: Checkpoint adding ! REP +1 !! - by Harish - 31.03.2012, 07:14
Re: Checkpoint adding ! REP +1 !! - by Avi57 - 31.03.2012, 07:26

Forum Jump:


Users browsing this thread: 1 Guest(s)