30.12.2012, 21:42
pawn Код:
#include <a_samp>
#define SHAMAL_ID 5
new Ccp[MAX_PLAYERS];
public OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp("/work", cmdtext, true) == 0)
{
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == SHAMAL_ID)
{
Ccp[playerid] = 1;
SetPlayerCheckpoint(playerid, -1367.5624,-221.9253,14.1484, 3.0);
SendClientMessage(playerid, 0xFFFFFFFF, "You started with working. Please follow the checkpoints");
}
else
{
}
return 1;
}
return 0;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(Ccp[playerid] == 1) // This checks if our variable equals to 1, if so: it continues
{
DisablePlayerCheckpoint(playerid); // This makes sure that there will be a new checkpoint
Ccp[playerid] = 2; // Changes the variable, so we can use it later again with OnPlayerEnterCheckpoint
SetPlayerCheckpoint(playerid, -1367.5624,-221.9253,14.1484, 3.0); // Creates a new checkpoint at a different position
SendClientMessage(playerid, 0xFFFFFFFF, "The passengers are in your plane now.\nNow, go to the new checkpoint to unload the passengers ");
return 1;
}
return 1;
}