10.07.2011, 05:53
Give this a try:
pawn Код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(pInfo[playerid][pJob] == 2 && pWorking[playerid] == 1)
{
if(MinerProgress[playerid] == 10)
{
SendClientMessage(playerid, INFO_COLOR, "You finished your job and you earned 1000000 dollars");
GivePlayerMoney(playerid, 10000000);
DestroyDynamicCP(MinerCP[playerid][0]);
DestroyDynamicCP(MinerCP[playerid][1]);
pWorking[playerid] = 0;
MinerProgress[playerid] = 0;
return 1;
}
if(checkpointid == MinerCP[playerid][0]) //First CP, show 2nd
{
DestroyDynamicCP(MinerCP[playerid][0]);
DestroyDynamicCP(MinerCP[playerid][1]);
MinerCP[playerid][1] = CreateDynamicCP(-446.1626,1230.4545,6.8758, 8, 1, -1, playerid, 1000);
MinerProgress[playerid] += 1;
return 1;
}
else if(checkpointid == MinerCP[playerid][1]) //2nd CP, show 1st
{
DestroyDynamicCP(MinerCP[playerid][0]);
DestroyDynamicCP(MinerCP[playerid][1]);
MinerCP[playerid][0] = CreateDynamicCP(-422.4301,1196.7813,6.7826, 8, 1, -1, playerid, 1000);
MinerProgress[playerid] += 1;
return 1;
}
}
return 1;
}