Percurso por mapicon - LeleziiN -  04/03/2021
 
 
Como posso ta criando um percurso só com MapIcons pois estou criando um sistema pra uma profissão e estou precisando disso. Poderiam mim explica como faço pfvr, ficaria muito agradecido
 
 
 
RE: Percurso por mapicon - Levi.M -  04/03/2021
 
 
Seria tipo na rota final? Se for use createmapicon e seta a posicao que vc quer, dps se quiser destroi.
 
 
 
RE: Percurso por mapicon - LeleziiN -  04/03/2021
 
 
 (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;         }     } 
 
  
 
 
 
RE: Percurso por mapicon - Levi.M -  04/03/2021
 
 
Você destrói, e cria o novo, com a nova posição.  
Código: RemovePlayerMapIcon(playerid, id do map icon aqui); 
//logo abaixo crie o novo mapicon com a posição desejada!
  
 
 
 
RE: Percurso por mapicon - LeleziiN -  04/03/2021
 
 
 (04/03/2021 14:42)Levi.M Escreveu:  Você destrói, e cria o novo, com a nova posição.  
Código: RemovePlayerMapIcon(playerid, id do map icon aqui); 
//logo abaixo crie o novo mapicon com a posição desejada!
   
Bom fiz dessa forma quando eu aperto "F" para entrar no veiculo aparece o MapIcon até ai tudo certo mais quando eu esvazio a lixeira o MapIcon destruir e na hora de criar outro em outra posição, ele criar na mesma posição que é a primeira 
 
Parte do comando 
 
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;                                     RemovePlayerMapIcon(playerid, 49);                                     SetPlayerMapIcon(playerid, 49, lixosLatasPos[a][0],lixosLatasPos[a][1],lixosLatasPos[a][2], 11, 0, MAPICON_GLOBAL);                                     PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0 );                                 }                                 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 );                        //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;         }     } 
 
  
 
 
 
RE: Percurso por mapicon - Levi.M -  04/03/2021
 
 
A variavel esta setando a posicao antiga! Tem que atualizar a variavel.
 
 
 
RE: Percurso por mapicon - xbruno1000x -  05/03/2021
 
 
Use a include cpstream.inc, com ela você pode usar um mapicon de forma similar a um checkpoint. 
 
https://raw.githubusercontent.com/hlgamesbr/Includes/master/cpstream.inc
 
 
 
RE: Percurso por mapicon - LeleziiN -  05/03/2021
 
 
 (04/03/2021 19:45)Levi.M Escreveu:  A variavel esta setando a posicao antiga! Tem que atualizar a variavel.  
E como devia fica pode mim da um exemplo pfvr? 
São 30 lixeiras no servidor
 
 
 
RE: Percurso por mapicon - Levi.M -  05/03/2021
 
 
Deixa os checkpoints randômicos, depois só colocar a variavel em  
Código PHP: SetPlayerMapIcon(playerid, 49, cordx,cordy,cordz, 56, 0, MAPICON_GLOBAL_CHECKPOINT); 
 
  
Essa parte aqui está funcionando? 
Código PHP: RemovePlayerMapIcon(playerid, 49); SetPlayerMapIcon(playerid, 49, lixosLatasPos[a][0],lixosLatasPos[a][1],lixosLatasPos[a][2], 11, 0, MAPICON_GLOBAL); 
 
  
 
 
 
RE: Percurso por mapicon - LeleziiN -  05/03/2021
 
 
 (05/03/2021 11:37)Levi.M Escreveu:  Essa parte aqui está funcionando? 
Código PHP: RemovePlayerMapIcon(playerid, 49); SetPlayerMapIcon(playerid, 49, lixosLatasPos[a][0],lixosLatasPos[a][1],lixosLatasPos[a][2], 11, 0, MAPICON_GLOBAL); 
 
   
Sim, mais quando termino de recolher a ultima sacola da lixeira ai em vez dela aparecer em outra lixeira, ela aparece na qual eu estou coletando. 
Como resolver isso?
 
 
 
 |