31.03.2012, 05:33
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;
}