16.07.2011, 03:04
pawn Код:
if(strcmp(cmdtext, "/work", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 1000, 1580.8534, 1534.2217, 10.8316))
{
//WorkInfo[playerid][IsWorking] = 1;
SendClientMessage(playerid, COLOR_WHITE, "Complete flight from {FFFF00}LVAP {FFFFFF}to {FFFF00}SFAP.");
SetPlayerCheckpoint(playerid, 1580.8534, 1534.2217, 10.8316, 5);
return 1;
}
//Sf to Ls (Flight 2)
else if(IsPlayerInRangeOfPoint(playerid, 1000, 1580.8534, 1534.2217, 10.8316))
{
//WorkInfo[playerid][IsWorking] = 2;
SendClientMessage(playerid, COLOR_WHITE, "Complete flight from {FFFF00}SFAP {FFFFFF}to {FFFF00}LSAP.");
SetPlayerCheckpoint(playerid, -1371.3795,-206.3711,14.1484, 5);
return 1;
}
//Ls to Lv (Flight 3)
else if(IsPlayerInRangeOfPoint(playerid, 1000, 1580.8534, 1534.2217, 10.8316))
{
//WorkInfo[playerid][IsWorking] = 3;
SendClientMessage(playerid, COLOR_WHITE, "Complete flight from {FFFF00}LSAP {FFFFFF}to {FFFF00}LVAP.");
SetPlayerCheckpoint(playerid, 1721.4504, -2415.5193, 13.5547, 5);
return 1;
}
}
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(WorkInfo[playerid][IsWorking] = 1)
{
SetPlayerCheckpoint(playerid, 0.0, 0.0, 0.0, 5);//change coordinates to flight one landing
}
else if(WorkInfo[playerid][IsWorking] = 2)
{
SetPlayerCheckpoint(playerid, 0.0, 0.0, 0.0, 5);//change to flight 2 landing
}
else
{
SetPlayercheckpoint(playerid, 0.0, 0.0, 0.0, 5);//change to flight 3 landing
}
return 1;
}
pawn Код:
else if (WorkInfo[playerid][IsWorking] > 0 && IsPlayerInPlane(playerid))
{
SendClientMessage(playerid, COLOR_WHITE, "{FF0000}Error: {FFFFFF}You are allready working!");
return 1;
}
pawn Код:
WorkInfo[playerid][IsWorking] == 1 //means Flight 1
WorkInfo[playerid][IsWorking] == 2 //means Flight 2
WorkInfo[playerid][IsWorking] //means Flight 3
pawn Код:
if(WorkInfo[playerid][IsWorking] > 0)