24.06.2018, 15:59
Vocк terб que transformar a variбvel random em um vetor usando o MAX PLAYERS pois cada player terб seu checkpoint randomico. No comando descarregar vocк usa a funзгo IsPlayerInRangeOfPoint e usa como argumentos a matriz Carregar com нndice da variбvel criada.
Exemplo:
Exemplo:
PHP код:
static Float: Descarregar[5][3] = {
{0.0,0.0,0.0}. // X Y Z coord 1
{1.0,2.0,3.0}. // X Y Z coord 2
{4.0,5.0,6.0} // X Y Z coord 3
{7.0,8.0,9.0} // X Y Z coord 4
{10.0, 11.0, 12.0} // X Y Z coord 5
};
new random[MAX_PLAYERS];
CMD:carregar(playerid)
{
random[playerid] = random(sizeof(Descarregar));
new index = random[playerid];
SetPlayerCheckpoint(playerid, Descarregar[index][0], Descarregar[index][1], Descarregar[index][2], 5.0);
SendClientMessage(playerid, -1, "[Caminhoneiros] Descarregue no ponto vermelho em seu mapa");
return 1;
}
CMD:descarregar(playerid)
{
new index = random[playerid];
if(!IsPlayerInRangeOfPoint(playerid,5.0,Descarregar[index][0], Descarregar[index][1], Descarregar[index][2]);
return SendClientMessage(playerid, -1,"Vocк nгo estб no local de entrega!");
return 1;
}