[Ajuda] Criar um comando
#1

Bem queria muito ajuda de vocкs para criar 2 comandinhos com esses cуdigo abaixo:

1:

Code:
AddHouse(houseid, Float:iconX, Float:iconY, Float:iconZ, Float:interiorX, Float:interiorY, Float:interiorZ, Costa, Sella, Interiora, virtualworld)
{
new house[128];
format(house, sizeof(house), "Casas/Casaid%d",houseid);
if(!dini_Exists(house))
{
dini_Create(house);
format(hInfo[houseid][aName], 24, "Ninguem");
dini_Set(house, "Name", "Ninguem");
format(hInfo[houseid][Renter], 24, "Ninguem");
dini_Set(house, "Renter", "Ninguem");
format(hInfo[houseid][Des], 80, "Nada");
dini_Set(house, "Des", "Nada");
format(hInfo[houseid][mensagemv], 100, "sem nome");
dini_Set(house, "mensagemv", "sem nome");
format(hInfo[houseid][Login], 80, "00/00/0000");
dini_Set(house, "Login", "00/00/0000");
hInfo[houseid][Rentable] = 0;
dini_IntSet(house, "Rentable", 0);
hInfo[houseid][Rentcost] = 0;
dini_IntSet(house, "TemDono", 0);
dini_IntSet(house, "Rentcost", 0);
hInfo[houseid][Cost] = Costa;
dini_IntSet(house, "Cost", Costa);
hInfo[houseid][Sell] = Sella;
dini_IntSet(house, "Sell", Sella);
dini_IntSet(house, "Casaid", houseid);
hInfo[houseid][Casaid] = houseid;
hInfo[houseid][Interior] = Interiora;
dini_IntSet(house, "Interior", Interiora);
dini_IntSet(house, "Virtualworld", virtualworld);
hInfo[houseid][Virtualworld] = virtualworld;
hInfo[houseid][Locked] = 0;
dini_IntSet(house, "Locked", 0);
hInfo[houseid][SemInt] = 0;
dini_IntSet(house, "SemInt", 0);
hInfo[houseid][liberado] = 0;
dini_IntSet(house, "liberado", 0);
hInfo[houseid][alarme] = 0;
dini_IntSet(house, "alarme", 0);
hInfo[houseid][Carrof] = 0;
dini_IntSet(house, "Carrof", 0);
hInfo[houseid][InteriorX] = interiorX;
hInfo[houseid][InteriorY] = interiorY;
hInfo[houseid][InteriorZ] = interiorZ;
dini_FloatSet(house, "X", interiorX);
dini_FloatSet(house, "Y", interiorY);
dini_FloatSet(house, "Z", interiorZ);
dini_IntSet(house, "RentPay", 0);
dini_IntSet(house, "RentGet", 0);
cInfo[houseid][HouseCar] = 509;
dini_IntSet(house, "HouseCar", 0);
cInfo[houseid][CarModel] = 509;
dini_IntSet(house, "CarModel", 0);
cInfo[houseid][VelX] = 0;
cInfo[houseid][VelY] = 0;
cInfo[houseid][VelZ] = 0;
cInfo[houseid][AnglE] = 0;
dini_FloatSet(house, "CarX", 0);
dini_FloatSet(house, "CarY", 0);
dini_FloatSet(house, "CarZ", 0);
dini_FloatSet(house, "Angle", 0);
cInfo[houseid][CarColor1] = 0;
cInfo[houseid][CarColor2] = 0;
dini_IntSet(house, "CarColor1", 0);
dini_IntSet(house, "CarColor2", 0);
cInfo[houseid][GotCar] = 0;
}
else
{
format(hInfo[houseid][aName], 24, dini_Get(house, "Name"));
format(hInfo[houseid][Renter], 24, dini_Get(house, "Renter"));
format(hInfo[houseid][Des], 80, dini_Get(house, "Des"));
format(hInfo[houseid][Des], 80, dini_Get(house, "Des"));
format(hInfo[houseid][Login], 80, dini_Get(house, "Login"));
hInfo[houseid][Rentable] = dini_Int(house, "Rentable");
hInfo[houseid][TemDono] = dini_Int(house, "TemDono");
hInfo[houseid][Rentcost] = dini_Int(house, "Rentcost");
hInfo[houseid][Cost] = dini_Int(house, "Cost");
hInfo[houseid][Sell] = dini_Int(house, "Sell");
hInfo[houseid][Casaid] = dini_Int(house, "Casaid");
hInfo[houseid][Interior] = dini_Int(house, "Interior");
hInfo[houseid][Locked] = dini_Int(house, "Locked");
hInfo[houseid][SemInt] = dini_Int(house, "SemInt");
hInfo[houseid][liberado] = dini_Int(house, "liberado");
hInfo[houseid][alarme] = dini_Int(house, "alarme");
hInfo[houseid][Carrof] = dini_Int(house, "Carrof");
hInfo[houseid][InteriorX] = dini_Float(house, "X");
hInfo[houseid][InteriorY] = dini_Float(house, "Y");
hInfo[houseid][InteriorZ] = dini_Float(house, "Z");
hInfo[houseid][Virtualworld] = dini_Int(house, "Virtualworld");
}
hInfo[houseid][iconx]=iconX;
hInfo[houseid][icony]=iconY;
hInfo[houseid][iconz]=iconZ;
new string[128];
format(house, sizeof(house), "Casas/Casaid%d",houseid);
if(dini_Int(house, "TemDono") == 0)
{
HousePickup[houseid] = CreatePickup(1273, 23, iconX, iconY, iconZ);
format(string, sizeof(string), "Casa %d", dini_Int(house, "Casaid"));
Create3DTextLabel(string, 0xFFFFFFAA, iconX, iconY, iconZ+0.80, 20.0, 0, 1);
}
else if(dini_Int(house, "TemDono") == 1)
{
HousePickup[houseid] = CreatePickup(1272, 23, iconX, iconY, iconZ);
format(string, sizeof(string), "Casa %d", dini_Int(house, "Casaid"));
Create3DTextLabel(string, 0xFFFFFFAA, iconX, iconY, iconZ+0.80, 20.0, 0,1);
}
}
2:

Code:
AddHouseCar(houseid, modelid, Float:Velx, Float:Vely, Float:Velz, Float:Angle , color1, color2, respawn_delay)
{
new house[128];
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][VelX] = Velx;
cInfo[houseid][VelY] = Vely;
cInfo[houseid][VelZ] = Velz;
cInfo[houseid][AnglE] = Angle;
dini_FloatSet(house, "CarX", Velx);
dini_FloatSet(house, "CarY", Vely);
dini_FloatSet(house, "CarZ", Velz);
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;

}
else
{
cInfo[houseid][CarModel] = dini_Int(house, "CarModel");
}
cInfo[houseid][VelX] = dini_Int(house, "CarX");
cInfo[houseid][VelY] = dini_Int(house, "CarY");
cInfo[houseid][VelZ] = 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], Velx, Vely, Velz, Angle, cInfo[houseid][CarColor1], cInfo[houseid][CarColor2], respawn_delay);
cInfo[houseid][AnglE] = dini_Int(house, "Angle");
}
}
Queria fazer os comandos /Criarcasa Preзo Interior e /SetCarroCasa ID COR1 COR2 , Mas nгo sei fazer, alguйm me ajuda por favor, esse fуrum e para um ajudar o outro e preciso muito de ajuda, obrigado.
Reply
#2

por que nгo procuras um sistema de casa, sу que em DOF2, caso queira algum desafio pode atй tentar achar um em MySQL/SQLite, a dini й bem lenta.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)