[DuV] Componentes nos Carros
#1

й o seguinte to fazendo um Game Mode aqui e tpo eu queria que quando ele carregasse o game mode ele adicionasse partes nos carros cujo eu especifiquei,
eu sei que tem como fazendo assim:
pawn Код:
new Carro1;

Carro1 = CreateVehicle(......)
mas Ai sгo muitas variaveis... pq olha eu tentei fazer assim:

E eu sei as ID dos Carros...

pawn Код:
public OnGameModeInit()
{
AddStaticVehicle(534,3405.1418,2353.6541,2.2513,162.2677,100,100); // Carro ADM NA ILHA [ID 155]
AddStaticVehicle(411,3400.4519,2351.6704,2.2412,184.7105,100,100); // Carro ADM NA ILHA [ID 156]
AddStaticVehicle(423,3397.3657,2351.8013,2.5541,181.0586,100,100); // Carro ADM NA ILHA [ID 157]
AddStaticVehicle(409,3384.5388,2345.9839,2.3258,89.7470,100,100); // Carro ADM NA ILHA [ID 158]
AddStaticVehicle(560,3373.2478,2351.9480,2.2373,181.1360,100,100); // Carro ADM NA ILHA [ID 159]
AddStaticVehicle(541,3370.4573,2351.6809,2.1551,178.4266,100,1); // Carro ADM NA ILHA [ID 160]
AddStaticVehicle(451,3367.6365,2351.9666,2.2171,175.0992,100,100); // Carro ADM NA ILHA [ID 161]
AddStaticVehicle(402,3364.3638,2352.3901,2.3697,179.2598,100,100); // Carro ADM NA ILHA [ID 162]
AddStaticVehicle(522,3368.1367,2323.1873,2.0856,3.6795,100,10); // Carro ADM NA ILHA [ID 163]
AddStaticVehicle(522,3369.9460,2322.4834,2.1017,13.5257,100,10); // Carro ADM NA ILHA [ID 164]
AddStaticVehicle(522,3372.2219,2322.8855,2.0922,16.0957,100,10); // Carro ADM NA ILHA [ID 165]
AddStaticVehicle(522,3374.4099,2322.5933,2.1002,5.9185,100,10); // Carro ADM NA ILHA [ID 166]
AddStaticVehicle(487,3424.7156,2356.8062,5.1697,89.4438,100,10); // Carro ADM NA ILHA [ID 167]
AddStaticVehicle(511,3475.6387,2424.6809,3.2439,180.0441,100,10); // Carro ADM NA ILHA [ID 168]
AddStaticVehicle(493,3432.4004,2395.2996,-0.1022,5.6732,100,10); // Barco ADm [ID 169]
AddStaticVehicle(493,3427.4014,2394.9243,0.7186,343.3596,100,10); // Barco ADm [ID 170]
AddStaticVehicle(574,3362.6445,2342.5181,2.2551,264.9393,100,100); // Carro ADM ChuQUI :B [ID 171]
return 1;
}

public OnVehicleSpawn(vehicleid)
{
    if(vehicleid >= 155 && vehicleid <= 171)
    {
    AddVehicleComponent(vehicleid,1010);
    if(vehicleid == 155)
    {
     AddVehicleComponent(vehicleid,1122);
     AddVehicleComponent(vehicleid,1123);
     AddVehicleComponent(vehicleid,1124);
     AddVehicleComponent(vehicleid,1125);
     AddVehicleComponent(vehicleid,1126);
     AddVehicleComponent(vehicleid,1127);
     ChangeVehiclePaintjob(vehicleid,1);
      }
    }
    return 1;
}
Qual o problema? Os veiculos estгo normais sem nada ''/... help me


================================================== ==============

PROBLEMA RESOLVIDO


pawn Код:
public OnGameModeInit()
{
AddStaticVehicle(534,3405.1418,2353.6541,2.2513,162.2677,100,100); // Carro ADM NA ILHA [155]
AddStaticVehicle(411,3400.4519,2351.6704,2.2412,184.7105,100,100); // Carro ADM NA ILHA [156]
AddStaticVehicle(423,3397.3657,2351.8013,2.5541,181.0586,100,100); // Carro ADM NA ILHA [157]
AddStaticVehicle(409,3384.5388,2345.9839,2.3258,89.7470,100,100); // Carro ADM NA ILHA [158]
AddStaticVehicle(560,3373.2478,2351.9480,2.2373,181.1360,100,100); // Carro ADM NA ILHA [159]
AddStaticVehicle(541,3370.4573,2351.6809,2.1551,178.4266,100,1); // Carro ADM NA ILHA [160]
AddStaticVehicle(451,3367.6365,2351.9666,2.2171,175.0992,100,100); // Carro ADM NA ILHA [161]
AddStaticVehicle(402,3364.3638,2352.3901,2.3697,179.2598,100,100); // Carro ADM NA ILHA [162]
AddStaticVehicle(522,3368.1367,2323.1873,2.0856,3.6795,100,10); // Carro ADM NA ILHA [163]
AddStaticVehicle(522,3369.9460,2322.4834,2.1017,13.5257,100,10); // Carro ADM NA ILHA [164]
AddStaticVehicle(522,3372.2219,2322.8855,2.0922,16.0957,100,10); // Carro ADM NA ILHA [165]
AddStaticVehicle(522,3374.4099,2322.5933,2.1002,5.9185,100,10); // Carro ADM NA ILHA [166]
AddStaticVehicle(487,3424.7156,2356.8062,5.1697,89.4438,100,10); // Carro ADM NA ILHA [167]
AddStaticVehicle(511,3475.6387,2424.6809,3.2439,180.0441,100,10); // Carro ADM NA ILHA [168]
AddStaticVehicle(493,3432.4004,2395.2996,-0.1022,5.6732,100,10); // Barco ADm [169]
AddStaticVehicle(493,3427.4014,2394.9243,0.7186,343.3596,100,10); // Barco ADm [170]
AddStaticVehicle(574,3362.6445,2342.5181,2.2551,264.9393,100,100); // Carro ADM ChuQUI :B [171]

TunarCarros();

return 1;
}

public OnVehicleSpawn(vehicleid)
{
SetTimer("TunarCarros",1000,0);
    return 1;
}
forward TunarCarros();
public TunarCarros()
{
for(new vi; vi < MaxVehicles; vi++)
{
      if(vi >= 155 && vi <= 171)
      {
     AddVehicleComponent(vi,1010);
    if(vi == 155)
    {
     AddVehicleComponent(vi,1122);
     AddVehicleComponent(vi,1123);
     AddVehicleComponent(vi,1124);
     AddVehicleComponent(vi,1125);
     AddVehicleComponent(vi,1126);
     AddVehicleComponent(vi,1127);
     ChangeVehiclePaintjob(vi,1);
      }
     }
 }
}
Reply
#2

Tens que criar o carro e depois meter-lhe os componentes que queres com o AddVehicleComponent(car id, comp id)

Lista:
https://sampwiki.blast.hk/wiki/Car_Component_ID
Reply
#3

error 017: undefined symbol "MaxVehicles"

Da esse erro para Mim Oque Eu Fasso?
Reply
#4

Quote:
Originally Posted by faeldk
error 017: undefined symbol "MaxVehicles"

Da esse erro para Mim Oque Eu Fasso?
amigo cada caso eh um caso,

no meu script MaxVehicles significa a quantidade de Veiculo que eu tenho no server,

no caso: #define MaxVehicles 171
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)