Code:
#include <a_samp>
#define Rotas 500;
CMD:carregar(playerid, params[])
{
new Truck = GetPlayerVehicleID(playerid);
if(GetVehicleModel(Truck) != 403)
return SendClientMessage(playerid, -1, "Esse nгo й o caminhгo da empresa.");
if(!IsPlayerInRangeOfPoint(playerid, 20.0, -1729.3949,14.3215,3.5547))
return SendClientMessage(playerid, -1, "{FF0040}Vocк nгo esta na area de carregamento!");
RemovePlayerMapIcon(playerid, 51);
ShowPlayerDialog(playerid, Rotas , DIALOG_STYLE_LIST, "Rotas", "Deposito de drogas de LS \nGalpгo de armas de LV", "Aceitar", "Rejeitar");
return 1;
}
public OnPlayerEnterCheckpoint(playerid)
{
if(Rotas[playerid] != 1)
{
new Truck = GetPlayerVehicleID(playerid);
if(GetVehicleModel(Truck) != 403) return SendClientMessage(playerid, -1, "{FF0040}Esse nгo й o caminhгo da empresa.");
if(!IsTrailerAttachedToVehicle(Truck)) return SendClientMessage(playerid, -1, "{FF0040}Vocк nгo carregou seu caminhгo!");
if(!IsPlayerInRangeOfPoint(playerid, 10.0, -1021.5939, -664.9120, 32.0078)) return SendClientMessage(playerid, Azul_Marinho, "Nгo estб na area de carregamento");
new trailerc = GetVehicleTrailer(Truck);
DetachTrailerFromVehicle(trailerc);
SetVehicleToRespawn(trailerc);
SendClientMessage(playerid, -1, "{FF0000}Caminhгo descarregado no deposito de drogas");
SendClientMessage(playerid, -1, "{FF0000}Pagamento: {00ff00}$2000");
GivePlayerMoney(playerid, 2000);
RemovePlayerMapIcon(playerid, 24);
DisablePlayerCheckpoint(playerid);
Rotas[playerid] = 0;
}
else
if(Rotas[playerid] != 2)
{
new Truck = GetPlayerVehicleID(playerid);
if(GetVehicleModel(Truck) != 403) return SendClientMessage(playerid, -1, "{FF0040}Esse nгo й o caminhгo da empresa.");
if(!IsTrailerAttachedToVehicle(Truck)) return SendClientMessage(playerid, -1, "{FF0040}Vocк nгo carregou seu caminhгo!");
if(!IsPlayerInRangeOfPoint(playerid, 10.0, 289.8005,2548.8125,16.8202)) return SendClientMessage(playerid, Azul-Marinho, "Nгo estб na area de carregamento");
new trailerc = GetVehicleTrailer(Truck);
DetachTrailerFromVehicle(trailerc);
SetVehicleToRespawn(trailerc);
SendClientMessage(playerid, -1, "{FF0000}Caminhгo descarregado no galpгo de armas");
SendClientMessage(playerid, -1, "{FF0000}Pagamento: {00ff00}$2000");
GivePlayerMoney(playerid, 2000);
RemovePlayerMapIcon(playerid, 24);
DisablePlayerCheckpoint(playerid);
Rotas[playerid] = 0;
}
return 1;
}
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == rotas)
{
switch(listitem)
{
case 0:
{
new veiculo = GetPlayerVehicleID(playerid);
if(!GetVehicleModel(veiculo) == 514) return SendClientMessage(playerid, -1, "Esse nгo й o caminhгo da empresa.");
if(!IsTrailerAttachedToVehicle(veiculo)) return SendClientMessage(playerid, -1, "Vocк nгo esta com a carga.");
SetPlayerMapIcon(playerid, 24, -1021.5939, -664.9120, 32.0078, -1, 24, MAPICON_GLOBAL);
SetPlayerCheckpoint(playerid, 2535.6519,-2122.8342,13.5469, 10.0);
SendClientMessage(playerid, -1, "{00FF00}Cargueiro carregado, Deposito de drogas de LS");
SendClientMessage(playerid, -1, "{00FF00}Foi marcado em seu mapa o local de descarregamento.");
RotaCarga[playerid] = 1;
}
case 1:
{
new veiculo = GetPlayerVehicleID(playerid);
if(!GetVehicleModel(veiculo) == 514) return SendClientMessage(playerid, -1, "Nгo й esse veiculo ta drogado?");
if(!IsTrailerAttachedToVehicle(veiculo)) return SendClientMessage(playerid, -1, "E a carga porra?");
SetPlayerMapIcon(playerid, 24, 2424, 2424, 2424, -1, 24, MAPICON_GLOBAL);
SetPlayerCheckpoint(playerid, 2424, 2424, 2424, 10.0);
SendClientMessage(playerid, -1, "{00FF00}Cargueiro carregado, Galpгo de armas de LV");
SendClientMessage(playerid, -1, "{00FF00}Foi marcado em seu mapa o local de descarregamento.");
RotaCarga[playerid] = 2;
}
}
}
}
return 1;
}