25.07.2011, 02:03
Or you can do this...
pawn Код:
//Add "CPID" to the player info enum.
//Under "OnPlayerConnect" add this line "PlayerInfo[playerid][CPID] = 0;" to reset the value.
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(vehicleid == DMV1 || vehicleid == DMV2 || vehicleid == DMV3)
{
if(PlayerInfo[playerid][DMV] == 1)
{
SetPlayerCheckpoint(playerid, 1427.2813, -1613.6610, 13.0077, 10.0);
PlayerInfo[playerid][CPID] = 1;
SendClientMessage(playerid,SYellow,"Please drive follow all the checkpoints, as you go alonge.");
return SendClientMessage(playerid,SYellow,"the weather may change, just keep calm and drive carefully.");
}
}
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
switch(PlayerInfo[playerid][CPID])
{
case 1:
{
//After the player enters the first checkpoint...
PlayerInfo[playerid][CPID] = 2;
SetPlayerCheckpoint(playerid, 1427.2813, -1613.6610, 13.0077, 10.0); //Show the 2nd cp
}
case 2:
{
//After the player enters the 2nd checkpoint... continue this process.
}
}
return 1;
}