19.03.2019, 22:00
Hello,
I'm doing a simple delivery system with dynamic checkpoints, using the include "streamer", but it's not working properly.
The right thing would be to enter the checkpoint and start the job, destroy it, create another checkpoint, and when he entered that new checkpoint, he would finish the job.
But he's just starting out and finishing work at the same checkpoint instantly.
What am I doing wrong?
The code:
Sorry for my bad English, this is not my language forum, but I came to do this post here because the creator of the streamer is from that area.
I'm doing a simple delivery system with dynamic checkpoints, using the include "streamer", but it's not working properly.
The right thing would be to enter the checkpoint and start the job, destroy it, create another checkpoint, and when he entered that new checkpoint, he would finish the job.
But he's just starting out and finishing work at the same checkpoint instantly.
What am I doing wrong?
The code:
PHP код:
CheckCarregar_TransportadorRefC[playerid] = CreateDynamicCP(-1005.3510,-676.9293,32.0078, 7.0, -1, -1, playerid, STREAMER_CP_SD, -1, 0);
SetPlayerMapIcon(playerid, 0, -1005.3510,-676.9293,32.0078, 0, 0xFF0000AA, 0);
PHP код:
public OnPlayerEnterDynamicCP(playerid, checkpointid)
{
if(checkpointid == CheckCarregar_TransportadorRefC[playerid])
{
if(IsPlayerInVehicleJob_01(playerid))
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
DestroyDynamicCP(CheckCarregar_TransportadorRefC[playerid]);
RemovePlayerMapIcon(playerid, 0);
SendClientMessage(playerid, -1, "loading.");
CheckDes_TransportadorRefC[playerid] = CreateDynamicCP(264.9304,1388.5432,10.5859, 7.0, -1, -1, playerid, STREAMER_CP_SD, -1, 0);
SetPlayerMapIcon(playerid, 0, 264.9304,1388.5432,10.5859, 0, 0xFF0000AA, 0);
} else SendClientMessage(playerid, -1, "Vocк nгo estб com o trailer da sua profissгo engatado");
} else return SendClientMessage(playerid, -1, "Esse nгo й seu veiculo de trabalho");
}
if(checkpointid == CheckDes_TransportadorRefC[playerid])
{
if(IsPlayerInVehicleJob_01(playerid))
{
if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
{
DestroyDynamicCP(CheckDes_TransportadorRefC[playerid]);
Player[playerid][pTrabalhando] = false;
SendClientMessage(playerid, -1, "finished.");
RemovePlayerMapIcon(playerid, 0);
} else SendClientMessage(playerid, -1, "Vocк nгo estб com o trailer da sua profissгo engatado");
} else return SendClientMessage(playerid, -1, "Esse nгo й seu veiculo de trabalho");
}
return 1;
}