[Ajuda] Spawn veiculo casa so pra casa que tenha dono
#1

alguem ajuda a arrumar so os carros das casas que tiverem dono pra spawnar as que nгo tem dono nгo spawnar?

pawn Code:
AddHouseCar(houseid, modelid, Float:Carx, Float:Cary, Float:Carz, Float:Angle , color1, color2, respawn_delay)
{
    new house[256];
    format(house, sizeof(house), "Casas/Casaid%d",houseid);
    if(dini_Exists(house))
    {
        cInfo[houseid][GotCar] = 1;
        if(dini_Int(house, "CarModel") == 0)
        {
            dini_IntSet(house, "CarModel", modelid);
            cInfo[houseid][CarModel] = modelid;
            cInfo[houseid][CarX] = Carx;
            cInfo[houseid][CarY] = Cary;
            cInfo[houseid][CarZ] = Carz;
            cInfo[houseid][AnglE] = Angle;
            dini_FloatSet(house, "CarX", Carx);
            dini_FloatSet(house, "CarY", Cary);
            dini_FloatSet(house, "CarZ", Carz);
            dini_FloatSet(house, "Angle", Angle);
            cInfo[houseid][CarColor1] = color1;
            cInfo[houseid][CarColor2] = color2;
            dini_IntSet(house, "CarColor1", color1);
            dini_IntSet(house, "CarColor2", color2);
            dini_IntSet(house, "Respawn_Delay", respawn_delay);
            cInfo[houseid][Respawn_Delay] = respawn_delay;
            cInfo[houseid][HouseCar] = CreateVehicle(cInfo[houseid][CarModel], Carx, Cary, Carz, Angle, color1, color2, respawn_delay);
        }
        else
        {
            cInfo[houseid][CarModel] = dini_Int(house, "CarModel");
        }
        cInfo[houseid][CarX] = dini_Int(house, "CarX");
        cInfo[houseid][CarY] = dini_Int(house, "CarY");
        cInfo[houseid][CarZ] = dini_Int(house, "CarZ");
        cInfo[houseid][CarColor1] = dini_Int(house, "CarColor1");
        cInfo[houseid][CarColor2] = dini_Int(house, "CarColor2");
        cInfo[houseid][HouseCar] = CreateVehicle(cInfo[houseid][CarModel], Carx, Cary, Carz, Angle, cInfo[houseid][CarColor1], cInfo[houseid][CarColor2], respawn_delay);
        cInfo[houseid][AnglE] = dini_Int(house, "Angle");
    }
}
Reply
#2

up '-'
Reply
#3

up alguem ajuda please ja tentei qse td n sei mt sobe pawno =/ alguem me ajuda
Reply
#4

tenta ai:

pawn Code:
if(cInfo[houseid][GotCar] == 1)
{
// spawn os veiculos
}
Reply
#5

nгo funciono ;s teria como alguem arrumar pra mim ?
pawn Code:
AddHouseCar(houseid, modelid, Float:Carx, Float:Cary, Float:Carz, Float:Angle , color1, color2, respawn_delay)
{
    new house[256];
    format(house, sizeof(house), "Casas/Casaid%d",houseid);
    if(dini_Exists(house))
    {
        cInfo[houseid][GotCar] = 1;
        if(dini_Int(house, "CarModel") == 0)
        {
            dini_IntSet(house, "CarModel", modelid);
            cInfo[houseid][CarModel] = modelid;
            cInfo[houseid][CarX] = Carx;
            cInfo[houseid][CarY] = Cary;
            cInfo[houseid][CarZ] = Carz;
            cInfo[houseid][AnglE] = Angle;
            dini_FloatSet(house, "CarX", Carx);
            dini_FloatSet(house, "CarY", Cary);
            dini_FloatSet(house, "CarZ", Carz);
            dini_FloatSet(house, "Angle", Angle);
            cInfo[houseid][CarColor1] = color1;
            cInfo[houseid][CarColor2] = color2;
            dini_IntSet(house, "CarColor1", color1);
            dini_IntSet(house, "CarColor2", color2);
            dini_IntSet(house, "Respawn_Delay", respawn_delay);
            cInfo[houseid][Respawn_Delay] = respawn_delay;
            cInfo[houseid][HouseCar] = CreateVehicle(cInfo[houseid][CarModel], Carx, Cary, Carz, Angle, color1, color2, respawn_delay);
        }
        else
        {
            cInfo[houseid][CarModel] = dini_Int(house, "CarModel");
        }
        cInfo[houseid][CarX] = dini_Int(house, "CarX");
        cInfo[houseid][CarY] = dini_Int(house, "CarY");
        cInfo[houseid][CarZ] = dini_Int(house, "CarZ");
        cInfo[houseid][CarColor1] = dini_Int(house, "CarColor1");
        cInfo[houseid][CarColor2] = dini_Int(house, "CarColor2");
        cInfo[houseid][HouseCar] = CreateVehicle(cInfo[houseid][CarModel], Carx, Cary, Carz, Angle, cInfo[houseid][CarColor1], cInfo[houseid][CarColor2], respawn_delay);
        cInfo[houseid][AnglE] = dini_Int(house, "Angle");
   }
}
pawn Code:
AddHouseCar(1,481,2473.4231,-1700.1005,13.2264,359.7954,0,0,0);// ryder
    AddHouseCar(2,481,2505.7642,-1693.8695,13.2632,2.4209,0,0,0); // casa cj
    AddHouseCar(3,481,2515.6123,-1671.6821,16.5071,57.4707,0,0,0); // groovesweet
    AddHouseCar(4,481,2506.7844,-1651.8859,13.3762,138.6450,0,0,0); // casa 114 90
    AddHouseCar(5,481,2485.0486,-1654.1677,13.0975,87.5635,0,0,0); // casa 113 140000
    AddHouseCar(6,481,2443.2395,-1638.1846,13.1371,179.1910,0,0,0); // casa 115 135
    AddHouseCar(7,481,2180.3345,-1662.3472,14.6045,222.6035,0,0,0); // casa 115 135
    AddHouseCar(8,481,2102.5872,-1271.0250,25.9908,179.8042,0,0,0); // casa 76 90
    AddHouseCar(9,481,2135.4387,-1328.6279,25.9569,0.2881,0,0,0); // casa 78 95
    AddHouseCar(10,481,2096.4668,-1328.4263,25.9299,1.0891,0,0,0); // casa 66 100
    AddHouseCar(11,481,2102.5872,-1271.0250,25.9908,179.8042,0,0,0); // casa 76 90
    AddHouseCar(12,481,2196.4060,-1276.1993,24.7055,180.6355,0,0,0); // casa 75 79
    AddHouseCar(13,481,2271.5613,-1024.2102,54.0839,226.7924,0,0,0); // casa 68 95
    AddHouseCar(14,481,2225.7051,-1060.3413,46.5664,226.5009,0,0,0); // casa 65 90
    AddHouseCar(15,481,2176.6472,-984.2581,65.1970,169.9724,0,0,0); // casa 69 97
    AddHouseCar(16,481,2093.9558,-968.1924,53.1532,166.9702,0,0,0); // casa 70 90
    AddHouseCar(17,481,2116.9197,-1058.3047,26.4622,140.7027,0,0,0); // casa 64 85
    AddHouseCar(18,481,2399.7363,-1134.4009,31.4747,180.6325,0,0,0); // casa 102 85
    AddHouseCar(19,481,2814.4514,-1179.1783,26.0275,269.9913,0,0,0); // casa 100 115
    AddHouseCar(20,481,2570.2429,-1029.3484,71.0922,177.0837,0,0,0); // casa 103 60
    AddHouseCar(21,481,1705.1051,-2130.7715,13.7619,359.6194,0,0,0); // casa 93 80
Reply
#6

up '-' alguem me ajuda '-'
Reply
#7

UP alguem ajuda ai '-'
Reply
#8

UP '-' alguem ajuda ;s arrumar pra spawnar so os carro q a casa tenha dono os q n tenha n spawnar ;s
Reply
#9

Crie uma verificaзгo para ver se tкm dono, se nгo tiver nгo spawn o carro ( quando esta aler as casas..)
Reply
#10

Quote:
Originally Posted by VeNuZ_
View Post
Crie uma verificaзгo para ver se tкm dono, se nгo tiver nгo spawn o carro ( quando esta aler as casas..)
e como eu criaria essa verficaзгo eu ja tentei criar nгo sei onde criar e nгo sei qual variavel le as casas poderia me ajudar?
Reply
#11

Podese seu codigo todo no pastebin e me mande por PM...
Reply
#12

Use algo como:
pawn Code:
if ( strcmp( hInfo[houseid][Name], "ForSale", false ) ) {
    // Casa tem dono
} else {
    cInfo[houseid][HouseCar] = CreateVehicle(cInfo[houseid][CarModel], Carx, Cary, Carz, Angle, color1, color2, respawn_delay);
}
Na lуgica vocк precisa pegar um dado gravado, que ira servir como bandeira/flag assim sendo possнvel que vocк possa fazer verificaзхes(condicionais), para atingir seu objetivo.



E deixe os crйditos do autor. ^^
Reply
#13

nгo sei quem й o autor quem me passo esse sistema de casa foi o Jim da [NWD] ano passado isso '-'
Reply
#14

vlw consegui e.e
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)