[Ajuda] veiculo profissao
#9

pjfPedro faz assim
Code:
#define MAX_CARROS_ORG 23//definir o nъmero de carros da org
new caminhao[MAX_CARROS_ORG];
Code:
public OnFilterScriptInit()
{
    caminhao[0] = CreateVehicle(403, 2778.1956, -2376.8271, 14.1051, 90.0000, 1, 1, 100);
    caminhao[1] = CreateVehicle(403, 2759.2173, -2375.7415, 14.1051, -90.1800, 1, 1, 100);
    caminhao[2] = CreateVehicle(403, 2759.2842, -2372.0630, 14.1051, -90.0000, 1, 1, 100);
    caminhao[3] = CreateVehicle(403, 2759.4177, -2368.5991, 14.1051, -90.0600, 1, 1, 100);
    caminhao[4] = CreateVehicle(403, 2759.2805, -2364.9226, 14.1051, -90.0600, 1, 1, 100);
    caminhao[5] = CreateVehicle(403, 2759.3254, -2361.0928, 14.1051, -90.0000, 1, 1, 100);
    caminhao[6] = CreateVehicle(403, 2759.5269, -2357.4207, 14.1051, -90.0000, 1, 1, 100);
    caminhao[7] = CreateVehicle(403, 2759.5083, -2353.4504, 14.1051, -90.2400, 1, 1, 100);
    caminhao[8] = CreateVehicle(403, 2759.6807, -2349.3396, 14.1051, -90.0000, 1, 1, 100);
    caminhao[9] = CreateVehicle(403, 2759.9221, -2345.4395, 14.1051, -90.0000, 1, 1, 100);
    caminhao[10] = CreateVehicle(403, 2759.8955, -2341.3167, 14.1051, -90.0600, 1, 1, 100);
    caminhao[11] = CreateVehicle(403, 2760.0535, -2337.0396, 14.1051, -90.0000, 1, 1, 100);
    caminhao[12] = CreateVehicle(403, 2759.3333, -2379.2683, 14.1051, -90.0000, 1, 1, 100);
    caminhao[13] = CreateVehicle(403, 2778.0913, -2381.0750, 14.1051, 90.0000, 1, 1, 100);
    caminhao[14] = CreateVehicle(403, 2777.8953, -2387.4812, 14.1051, 90.0000, 1, 1, 100);
    caminhao[15] = CreateVehicle(403, 2777.9941, -2384.3052, 14.1051, 90.0000, 1, 1, 100);
    caminhao[16] = CreateVehicle(403, 2777.5559, -2395.3184, 14.1051, 90.0000, 1, 1, 100);
    caminhao[17] = CreateVehicle(403, 2777.4539, -2398.8093, 14.1051, 90.0000, 1, 1, 100);
    caminhao[18] = CreateVehicle(403, 2777.3525, -2402.2456, 14.1051, 90.0000, 1, 1, 100);
    caminhao[19] = CreateVehicle(403, 2777.6592, -2391.8167, 14.1051, 90.0000, 1, 1, 100);
    caminhao[20] = CreateVehicle(403, 2775.9270, -2418.2512, 14.1051, 90.0000, 1, 1, 100);
    caminhao[21] = CreateVehicle(403, 2774.7324, -2455.2065, 14.1051, 90.0000, 1, 1, 100);
    caminhao[22] = CreateVehicle(403, 2774.7046, -2493.5581, 14.1051, 90.0000, 1, 1, 100); 
return 1;
}
proximo
Code:
new profissao = 0; // fiz isso para simular o PlayerInfo[playerid][IdDaOrg]
Code:
cmd:darprofissao(playerid){
  ++profissao;
  return 1;
}
cmd:removerprofissao(playerid){
  --profissao;
  return 1;
}
public OnPlayerStateChange(playerid, newstate, oldstate)
{
  for(new c = 0; c <= 23; c++)
    {
        if(IsPlayerInVehicle(playerid, caminhao[c]) && profissao != 1)
        {
            SendClientMessage(playerid, -1, "voce nao e um caminhoneiro");
            RemovePlayerFromVehicle(playerid);
            break;
        }
    }
  return 1;
}
edit: se quiser adicionar mais organizaзгo/profissгo segui o exemplo https://pastebin.com/0e27tER1
creditos: https://sampforum.blast.hk/showthread.php?tid=395339
Reply


Messages In This Thread
veiculo profissao - by pjfPedro - 27.04.2020, 01:31
Re: veiculo profissao - by pjfPedro - 27.04.2020, 01:41
Re: veiculo profissao - by RayanSanty - 27.04.2020, 01:44
Re: veiculo profissao - by Hatiro - 27.04.2020, 01:45
Re: veiculo profissao - by RayanSanty - 27.04.2020, 01:47
Re: veiculo profissao - by pjfPedro - 27.04.2020, 01:48
Re: veiculo profissao - by pjfPedro - 27.04.2020, 01:54
Re: veiculo profissao - by pjfPedro - 27.04.2020, 02:14
Re: veiculo profissao - by Hatiro - 27.04.2020, 02:52
Re: veiculo profissao - by pjfPedro - 27.04.2020, 11:27

Forum Jump:


Users browsing this thread: 3 Guest(s)