06.06.2017, 00:02
Quote:
Toma essa base que acabei de fazer ae, espero que entenda.
PHP код:
|
PHP код:
CMD:carregar(playerid, params[])
{
new vehicle = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehicle) == 514)
{
if (IsPlayerInRangeOfPoint(playerid, 20.0, -7.2738, 1523.3784, 12.7500))
{
ShowPlayerDialog(playerid, rotas, DIALOG_STYLE_LIST, "Rotas", "Usina De San Fierro", "Quero Essa", "Ir nessa");
RemovePlayerMapIcon(playerid, 51);
}else{
SendClientMessage(playerid, -1, "{FF0040}Vocк nгo esta na area de carregamento!");
SendClientMessage(playerid, -1, "{00FF00}Foi marcado em seu mapa a area de carregamento.");
SetPlayerMapIcon(playerid, 51, -7.2738, 1523.3784, 12.7500, 51, 0, MAPICON_GLOBAL);
}
}else{
SendClientMessage(playerid, -1, "{FF0040}Vai carregar nas costa ?");
}
return 1;
}
PHP код:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
if(dialogid == rotas)
{
switch(listitem)
{
case 0:
{
new veiculo = GetPlayerVehicleID(playerid);
if(GetVehicleModel(veiculo) == 514){
new vehiclev = GetPlayerVehicleID(playerid);
if(IsTrailerAttachedToVehicle(vehiclev)){
SetPlayerMapIcon(playerid, 24, -1021.5939, -664.9120, 32.0078, -1, 24, MAPICON_GLOBAL);
SetPlayerCheckpoint(playerid, -1021.5939, -664.9120, 32.0078, 10.0);
SendClientMessage(playerid, -1, "{00FF00}Cargueiro carregado!!!");
SendClientMessage(playerid, -1, "{00FF00}Foi marcado em seu mapa o local de descarregamento.");
}else{
SendClientMessage(playerid, -1, "{FF0000}e a carga ???");
}
}
}
}
}
}
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
if (IsPlayerInCheckpoint(playerid))
{
new vehiclevv = GetPlayerVehicleID(playerid);
if(GetVehicleModel(vehiclevv) == 514){
new vehiclev = GetPlayerVehicleID(playerid);
if(IsTrailerAttachedToVehicle(vehiclev))
{
if (IsPlayerInRangeOfPoint(playerid, 10.0, -1021.5939, -664.9120, 32.0078))
{
new vehiclecc = GetPlayerVehicleID(playerid);
new trailerc = GetVehicleTrailer(vehiclecc);
DetachTrailerFromVehicle(trailerc);
SetVehicleToRespawn(trailerc);
SendClientMessage(playerid, -1, "{FF0000}Caminhгo descarregado!");
SendClientMessage(playerid, -1, "{FF0000}Pagamento: {00ff00}$2000");
GivePlayerMoney(playerid, 2000);
RemovePlayerMapIcon(playerid, 24);
DisablePlayerCheckpoint(playerid);
}else{
SendClientMessage(playerid, -1, "{FF0040}Vocк nгo carregou seu caminhгo!");
}
}
}
}else{
SendClientMessage(playerid, -1, "{FF0040}Vocк nгo esta com um caminhгo!");
}
return 1;
}