11.03.2012, 13:21
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 5, -2105.5925,-2403.5745,31.3825)){
if(pRouteStatus[playerid] == 1 && pRoute[playerid] == 1){
pRouteStatus[playerid] = 2;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, sbInfo[pFactoryID[playerid]][ENX],sbInfo[pFactoryID[playerid]][ENY],sbInfo[pFactoryID[playerid]][ENZ], 5.0);
return SendClientMessage(playerid, COLOR_WHITE, "[FACTORY:] Head to the weapons factory unload point to deliver materials. Type /cancelmission to cancel the mission.");
}
}
if(IsPlayerInRangeOfPoint(playerid, 5, 2306.9885,-5318.7769,2.0906)){
if(pRouteStatus[playerid] == 1 && pRoute[playerid] == 2){
pRouteStatus[playerid] = 2;
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, sbInfo[pFactoryID[playerid]][ENX],sbInfo[pFactoryID[playerid]][ENY],sbInfo[pFactoryID[playerid]][ENZ], 5.0);
return SendClientMessage(playerid, COLOR_WHITE, "[FACTORY:] Head to the weapons factory unload point to deliver materials. Type /cancelmission to cancel the mission.");
}
}
if(IsPlayerInRangeOfPoint(playerid, 5, sbInfo[pFactoryID[playerid]][ENX],sbInfo[pFactoryID[playerid]][ENY],sbInfo[pFactoryID[playerid]][ENZ])){
if(pRouteStatus[playerid] == 2){
pRouteStatus[playerid] = 0;
sbInfo[pFactoryID[playerid]][WeaponParts] += pMaterials[playerid];
new string[150]; format(string, 150, "[FACTORY:] %i materials delivered to the factory. Total materials: %i. Type /checkmats to check the materials amount.", pMaterials[playerid], sbInfo[pFactoryID[playerid]][WeaponParts]);
pMaterials[playerid] = 0;
pFactoryID[playerid] = -1;
return SendClientMessage(playerid, COLOR_WHITE, string);
}
}
return 1;
}