04/03/2021 14:26
(04/03/2021 12:56)Levi.M Escreveu: Seria tipo na rota final? Se for use createmapicon e seta a posicao que vc quer, dps se quiser destroi.
Certo mais como faço pra quando eu pegar a terceira sacola o mapicon muda para outra posição?
Comando de pegar a sacola de lixo
Código PHP:
if(strcmp(cmd, "/coletar", true) == 0)
{
if(Profissao[playerid] == Gari || VerificarADM(playerid) == 1)
{
if(IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, CORX1, "| ERRO | Você não pode coletar lixo dentro de um veiculo!");
/*else */if(!profissaoCar[playerid] == false)
{
new Float:vehx, Float:vehy, Float:vehz;
GetVehiclePos(profissaoCar[playerid], vehx, vehy, vehz);
if(IsPlayerInRangeOfPoint(playerid, 40.0, vehx, vehy, vehz))
{
for (new a = 0; a < sizeof(lixosLatasPos); a++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, lixosLatasPos[a][0],lixosLatasPos[a][1],lixosLatasPos[a][2]))
{
if(lixosLatasPos[a][3] == 3.0)
{
if(profissaoCarregandoOJG[playerid])
{
SendClientMessage(playerid, CORX1, "| ERRO | Você já está com uma sacola de lixo na mão!");
return 1;
}
else
{
SendClientMessage(playerid, COR_MARA2, "| INFO | Você coletou um saco de lixo com sucesso! Para colocá-lo no caminhão, vá no checkpoint atrás do mesmo.");
SendClientMessage(playerid, COR_MARA2, "| INFO | Você pode largar o saco de lixo utilizando a tecla 'N'.");
Update3DTextLabelText(lixosLatasText[a], 0xFFFFFFFF, "{f2da3c}Caçamba 2/3:\n{FFFFFF}Use /coletar para pegar um saco de lixo.");
lixosLatasPos[a][3] = 2.0;
//ApplyAnimation(playerid, "CARRY", "LIFTUP", 4.1, 0, 1, 1, 0, 0, 0);
//ApplyAnimation(playerid, "CARRY", "PUTDWN", 4.1, 0, 1, 1, 0, 0, 0);
ApplyAnimation(playerid, "CARRY", "LIFTUP105", 4.1, 0, 1, 1, 0, 0, 0);
SetPlayerAttachedObject(playerid, 2, 1265, 5, 0.1, 0.07, 0.04, 180.0, 0.0, 0.0, 0.5, 0.5, 0.5);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, (vehx+4.0), vehy, vehz, 3.0);
profissaoCarregandoOJG[playerid] = true;
return 1;
}
}
else if(lixosLatasPos[a][3] == 2.0)
{
if(profissaoCarregandoOJG[playerid])
{
return SendClientMessage(playerid, CORX1, "| ERRO | Você já está com uma sacola de lixo na mão!");
}
else
{
SendClientMessage(playerid, COR_MARA2, "| INFO | Você coletou um saco de lixo com sucesso! Para colocá-lo no caminhão, vá no checkpoint atrás do mesmo.");
SendClientMessage(playerid, COR_MARA2, "| INFO | Você pode largar o saco de lixo utilizando a tecla 'N'.");
Update3DTextLabelText(lixosLatasText[a], 0xFFFFFFFF, "{ff4500}Caçamba 1/3:\n{FFFFFF}Use /coletar para pegar um saco de lixo.");
lixosLatasPos[a][3] = 1.0;
//ApplyAnimation(playerid, "CARRY", "LIFTUP", 4.1, 0, 1, 1, 0, 0, 0);
//ApplyAnimation(playerid, "CARRY", "PUTDWN", 4.1, 0, 1, 1, 0, 0, 0);
ApplyAnimation(playerid, "CARRY", "LIFTUP105", 4.1, 0, 1, 1, 0, 0, 0);
SetPlayerAttachedObject(playerid, 2, 1265, 5, 0.1, 0.07, 0.04, 180.0, 0.0, 0.0, 0.5, 0.5, 0.5);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, (vehx+4.0), vehy, vehz, 3.0);
profissaoCarregandoOJG[playerid] = true;
}
return 1;
}
else if(lixosLatasPos[a][3] == 1.0)
{
if(profissaoCarregandoOJG[playerid])
{
SendClientMessage(playerid, CORX1, "| ERRO | Você já está com uma sacola de lixo na mão!");
return 1;
}
else
{
SendClientMessage(playerid, COR_MARA2, "| INFO | Você coletou um saco de lixo com sucesso! Para colocá-lo no caminhão, vá no checkpoint atrás do mesmo.");
SendClientMessage(playerid, COR_MARA2, "| INFO | Você pode largar o saco de lixo utilizando a tecla 'N'.");
SendClientMessage(playerid, COR_ORKUT, "| INFO | Você coletou um saco de lixo.");
Update3DTextLabelText(lixosLatasText[a], 0xFFFFFFFF, "{f2543c}Caçamba vazia\n{FFFFFF}Siga para outra, pra recolher os sacos de lixo.");
lixosLatasPos[a][3] = 0.0;
//ApplyAnimation(playerid, "CARRY", "LIFTUP", 4.1, 0, 1, 1, 0, 0, 0);
//ApplyAnimation(playerid, "CARRY", "PUTDWN", 4.1, 0, 1, 1, 0, 0, 0);
ApplyAnimation(playerid, "CARRY", "LIFTUP105", 4.1, 0, 1, 1, 0, 0, 0);
SetPlayerAttachedObject(playerid, 2, 1265, 5, 0.1, 0.07, 0.04, 180.0, 0.0, 0.0, 0.5, 0.5, 0.5);
DisablePlayerCheckpoint(playerid);
SetPlayerCheckpoint(playerid, (vehx+4.0), vehy, vehz, 3.0);
profissaoCarregandoOJG[playerid] = true;
}
return 1;
}
else
{
SendClientMessage(playerid, CORX1, "| ERRO | Essa lixeira está vazia procure outra!");
return 1;
}
}
}
SendClientMessage(playerid, CORX1, "| ERRO | Você não está próximo de uma lixeira!");
return 1;
}
else
{
SendClientMessage(playerid, COR_ORKUT, "| INFO | Você não está próximo do seu carro de lixo!");
SendClientMessage(playerid, COR_ORKUT, "| INFO | Foi marcado no seu radar o local do seu carro de lixo!");
SetPlayerMapIcon(playerid, 49, 2163.3389,-1979.0389,13.5534, 56, 0, MAPICON_GLOBAL_CHECKPOINT );
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0 );
//SetPlayerMapIcon(playerid, GPS_ID, vehx, vehy, vehz, GPS_ICON, 0, MAPICON_GLOBAL);
//PlayerPlaySound(playerid, 1057, 0 ,0, 0);
//HQ[playerid] = true;
return 1;
}
}
else
{
SendClientMessage(playerid, CORX1, "| ERRO | Vá até a fabrica de reciclagem para buscar um caminhão!");
return 1;
}
}
else
{
SendClientMessage(playerid,CORX1,"| ERRO | Você não tem permissão!");
return 1;
}
}