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);
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;
}
if(checkpointid == CheckCarregar_TransportadorRefC[playerid]) if(checkpointid == CheckDes_TransportadorRefC[playerid]) |
First time you create the CP, you store the returned id from the function CreateDynamicCP into the variable 'CheckCarregar_TransportadorRefC[playerid]'
Lets just assume it is the first CP since server start created and stored into your variable. Your variable 'CheckCarregar_TransportadorRefC[playerid]' is now containing the number '1'. As when you create a second CP and store it in the other variable, the number would be 2. BUT... You are deleting the first CP before creating the second CP, meaning that you just freed up slot 1 from the CP and the next CP created will be 1, meaning you are now getting a conflict on these two lines because they are equal: because you are not ending your first code within the checker from 'if(checkpointid == CheckCarregar_TransportadorRefC[playerid]) ' with a 'return' this problem happens. add a return 1; in each statement Set the variable to 0 when deleted with destroydynamiccp |
First time you create the CP, you store the returned id from the function CreateDynamicCP into the variable 'CheckCarregar_TransportadorRefC[playerid]'
Lets just assume it is the first CP since server start created and stored into your variable. Your variable 'CheckCarregar_TransportadorRefC[playerid]' is now containing the number '1'. As when you create a second CP and store it in the other variable, the number would be 2. BUT... You are deleting the first CP before creating the second CP, meaning that you just freed up slot 1 from the CP and the next CP created will be 1, meaning you are now getting a conflict on these two lines because they are equal: because you are not ending your first code within the checker from 'if(checkpointid == CheckCarregar_TransportadorRefC[playerid]) ' with a 'return' this problem happens. add a return 1; in each statement Set the variable to 0 when deleted with destroydynamiccp |
public OnPlayerEnterDynamicCP(playerid, checkpointid) { if(checkpointid == CheckCarregar_TransportadorRefC[playerid]) { if(IsPlayerInVehicleJob_01(playerid)) { if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) { DestroyDynamicCP(CheckCarregar_TransportadorRefC[playerid]); CheckCarregar_TransportadorRefC[playerid] = -1; 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 SendClientMessage(playerid, -1, "Esse nгo й seu veiculo de trabalho"); } else if(checkpointid == CheckDes_TransportadorRefC[playerid]) { if(IsPlayerInVehicleJob_01(playerid)) { if(IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid))) { DestroyDynamicCP(CheckDes_TransportadorRefC[playerid]); CheckDes_TransportadorRefC[playerid] = -1; 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 SendClientMessage(playerid, -1, "Esse nгo й seu veiculo de trabalho"); } return 1; }