10.07.2011, 05:14
EDIT: Fixed it, I have another problem though.
I made a job, and you have to go back and forward through 2 checkpoints. When you enter the first one, it dissapears as it should to, and the second one appears. But when You enter the seconds one, it dissapears but the first one doesn't appear. Instead, the second one appears again. I don't see where the problem is.
I made a job, and you have to go back and forward through 2 checkpoints. When you enter the first one, it dissapears as it should to, and the second one appears. But when You enter the seconds one, it dissapears but the first one doesn't appear. Instead, the second one appears again. I don't see where the problem is.
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]){
DestroyDynamicCP(checkpointid);
MinerCP[playerid][1] = CreateDynamicCP(-446.1626,1230.4545,6.8758, 8, 1, -1, playerid, 1000);
MinerProgress[playerid] += 1;
return 1;
}
if(checkpointid == MinerCP[playerid][1]){
DestroyDynamicCP(checkpointid);
MinerCP[playerid][0] = CreateDynamicCP(-422.4301,1196.7813,6.7826, 8, 1, -1, playerid, 1000);
MinerProgress[playerid] += 1;
return 1;
}
}
return 1;
}