[Pomoc] dini u yini

Započeo xyzcod2, Avgust 22, 2013, 18:24:20 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Skripta koju koristim: moj mod od 0
Detaljan opis problema: nebih to nazvao bas problemom al ajd, znaci nikako nisam mogao da napravim svoj save tuning sistem pa sam trazio malo tutove i naisao na jedan tutorial(Autor: FlasH). Eh sad, taj tutorial je u Dini-u, a ja koristim yini, pa jel bi mi mogao netko pomoc da mi prevede kod koji cu dole navesti iz Dini-a u yini, posto ja nikad nisam radio sa Diniem. Enum vozila je VoziloInfo
Dio skripte:
InitComponents(componentid) // Ovdje bira tuning vozila,koji smo definirali gore,felge,spoiler itd.
{
new i;
for(i=0; i<20; i++)
{
    if(spoiler[i][0]==componentid)
{
return 1;
}
}
for(i=0; i<3; i++)
{
    if(nitro[i][0]==componentid)
{
return 2;
}
}
for(i=0; i<23; i++)
{
    if(fbumper[i][0]==componentid)
    {
return 3;
}
}
for(i=0; i<22; i++)
{
    if(rbumper[i][0]==componentid)
    {
return 4;
}
}
for(i=0; i<28; i++)
{
    if(exhaust[i][0]==componentid)
    {
return 5;
}
}
for(i=0; i<2; i++)
{
    if(bventr[i][0]==componentid)
    {
return 6;
}
}
for(i=0; i<2; i++)
{
    if(bventl[i][0]==componentid)
        {
return 7;
}
}
for(i=0; i<4; i++)
{
    if(bscoop[i][0]==componentid)
    {
return 8;
}
}
for(i=0; i<13; i++)
{
    if(rscoop[i][0]==componentid)
    {
return 9;
}
}
for(i=0; i<21; i++)
{
    if(lskirt[i][0]==componentid)
    {
return 10;
}
}
for(i=0; i<21; i++)
{
    if(rskirt[i][0]==componentid)
    {
return 11;
}
}
if(hydraulics[0][0]==componentid)
{
return 12;
}
if(base[0][0]==componentid)
{
return 13;
}
for(i=0; i<2; i++)
{
    if(rbbars[i][0]==componentid)
    {
return 14;
}
}
for(i=0; i<2; i++)
{
    if(fbbars[i][0]==componentid)
    {
return 15;
}
}
for(i=0; i<17; i++)
{
    if(wheels[i][0]==componentid)
    {
return 16;
}
}
for(i=0; i<2; i++)
{
    if(tunelights[i][0]==componentid)
    {
return 17;
}
}
return 0;
}

public TuneThisCar(vehicleid) // Ovime dodajemo tuning na vozilo.
{
if(TuneCar[vehicleid][mod1]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod1]); }
if(TuneCar[vehicleid][mod2]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod2]); }
if(TuneCar[vehicleid][mod3]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod3]); }
if(TuneCar[vehicleid][mod4]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod4]); }
if(TuneCar[vehicleid][mod5]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod5]); }
if(TuneCar[vehicleid][mod6]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod6]); }
if(TuneCar[vehicleid][mod7]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod7]); }
if(TuneCar[vehicleid][mod8]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod8]); }
if(TuneCar[vehicleid][mod9]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod9]); }
if(TuneCar[vehicleid][mod10]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod10]); }
if(TuneCar[vehicleid][mod11]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod11]); }
if(TuneCar[vehicleid][mod12]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod12]); }
if(TuneCar[vehicleid][mod13]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod13]); }
if(TuneCar[vehicleid][mod14]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod14]); }
if(TuneCar[vehicleid][mod15]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod15]); }
if(TuneCar[vehicleid][mod16]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod16]); }
if(TuneCar[vehicleid][mod17]!=0) { AddVehicleComponent(vehicleid,TuneCar[vehicleid][mod17]); }
if(TuneCar[vehicleid][colorA]!=0 || TuneCar[vehicleid][colorB]!=0)
{
ChangeVehicleColor(vehicleid,TuneCar[vehicleid][colorA],TuneCar[vehicleid][colorB]);
}
if(TuneCar[vehicleid][paintjob]!=0) { ChangeVehiclePaintjob(vehicleid,TuneCar[vehicleid][paintjob]); }
return 1;
}

public SaveModsForAll(vehicleid) // Ovime spremamo tuning vozila
{
new formatLD[256];
format(formatLD,sizeof(formatLD),"Tuning_Vozila/%d.mods",vehicleid); // Ovo je datoteka u koju salje tuning da ga spremi
if(dini_Exists(formatLD))
{
dini_IntSet(formatLD,"mod1",TuneCar[vehicleid][mod1]);
dini_IntSet(formatLD,"mod2",TuneCar[vehicleid][mod2]);
dini_IntSet(formatLD,"mod3",TuneCar[vehicleid][mod3]);
dini_IntSet(formatLD,"mod4",TuneCar[vehicleid][mod4]);
dini_IntSet(formatLD,"mod5",TuneCar[vehicleid][mod5]);
dini_IntSet(formatLD,"mod6",TuneCar[vehicleid][mod6]);
dini_IntSet(formatLD,"mod7",TuneCar[vehicleid][mod8]);
dini_IntSet(formatLD,"mod9",TuneCar[vehicleid][mod9]);
dini_IntSet(formatLD,"mod10",TuneCar[vehicleid][mod10]);
dini_IntSet(formatLD,"mod11",TuneCar[vehicleid][mod11]);
dini_IntSet(formatLD,"mod12",TuneCar[vehicleid][mod12]);
dini_IntSet(formatLD,"mod13",TuneCar[vehicleid][mod13]);
dini_IntSet(formatLD,"mod14",TuneCar[vehicleid][mod14]);
dini_IntSet(formatLD,"mod15",TuneCar[vehicleid][mod15]);
dini_IntSet(formatLD,"mod16",TuneCar[vehicleid][mod16]);
dini_IntSet(formatLD,"mod17",TuneCar[vehicleid][mod17]);
dini_IntSet(formatLD,"paintjob",TuneCar[vehicleid][paintjob]);
dini_IntSet(formatLD,"color1",TuneCar[vehicleid][colorA]);
dini_IntSet(formatLD,"color2",TuneCar[vehicleid][colorB]);
}
else
{
dini_Create(formatLD);
dini_IntSet(formatLD,"mod1",TuneCar[vehicleid][mod1]);
dini_IntSet(formatLD,"mod2",TuneCar[vehicleid][mod2]);
dini_IntSet(formatLD,"mod3",TuneCar[vehicleid][mod3]);
dini_IntSet(formatLD,"mod4",TuneCar[vehicleid][mod4]);
dini_IntSet(formatLD,"mod5",TuneCar[vehicleid][mod5]);
dini_IntSet(formatLD,"mod6",TuneCar[vehicleid][mod6]);
dini_IntSet(formatLD,"mod7",TuneCar[vehicleid][mod8]);
dini_IntSet(formatLD,"mod9",TuneCar[vehicleid][mod9]);
dini_IntSet(formatLD,"mod10",TuneCar[vehicleid][mod10]);
dini_IntSet(formatLD,"mod11",TuneCar[vehicleid][mod11]);
dini_IntSet(formatLD,"mod12",TuneCar[vehicleid][mod12]);
dini_IntSet(formatLD,"mod13",TuneCar[vehicleid][mod13]);
dini_IntSet(formatLD,"mod14",TuneCar[vehicleid][mod14]);
dini_IntSet(formatLD,"mod15",TuneCar[vehicleid][mod15]);
dini_IntSet(formatLD,"mod16",TuneCar[vehicleid][mod16]);
dini_IntSet(formatLD,"mod17",TuneCar[vehicleid][mod17]);
dini_IntSet(formatLD,"paintjob",TuneCar[vehicleid][paintjob]);
dini_IntSet(formatLD,"color1",TuneCar[vehicleid][colorA]);
dini_IntSet(formatLD,"color2",TuneCar[vehicleid][colorB]);
}
return 0;
}

public OnVehicleMod(playerid,vehicleid,componentid) // Tuniramo vozilo ovime
{
new Varz=InitComponents(componentid);
switch (Varz)
{
case 1:
{
TuneCar[vehicleid][mod1]=componentid;
}
case 2:
{
TuneCar[vehicleid][mod2]=componentid;
}
case 3:
{
TuneCar[vehicleid][mod3]=componentid;
}
case 4:
{
TuneCar[vehicleid][mod4]=componentid;
}
case 5:
{
TuneCar[vehicleid][mod5]=componentid;
}
case 6:
{
TuneCar[vehicleid][mod6]=componentid;
}
case 7:
{
TuneCar[vehicleid][mod7]=componentid;
}
case 8:
{
TuneCar[vehicleid][mod8]=componentid;
}
case 9:
{
TuneCar[vehicleid][mod9]=componentid;
}
case 10:
{
TuneCar[vehicleid][mod10]=componentid;
}
case 11:
{
TuneCar[vehicleid][mod11]=componentid;
}
case 12:
{
TuneCar[vehicleid][mod12]=componentid;
}
case 13:
{
TuneCar[vehicleid][mod13]=componentid;
}
case 14:
{
TuneCar[vehicleid][mod14]=componentid;
}
case 15:
{
TuneCar[vehicleid][mod15]=componentid;
}
case 16:
{
TuneCar[vehicleid][mod16]=componentid;
}
case 17:
{
TuneCar[vehicleid][mod17]=componentid;
}
}
printf("Tuning vozila sacuvan: %d",componentid);
SaveModsForAll(vehicleid);
return 1;
}

public LoadModsForAll(vehicleid) // Ucitavamo tuning vozila
{
new formatLD[256];
format(formatLD,sizeof(formatLD),"Tuning_Vozila/%d.mods",vehicleid); // Ucitavamo tuning vozila iz foldera Tuning_Vozila
if(dini_Exists(formatLD))
{
TuneCar[vehicleid][mod1] = dini_Int(formatLD, "mod1");
TuneCar[vehicleid][mod2] = dini_Int(formatLD, "mod2");
TuneCar[vehicleid][mod3] = dini_Int(formatLD, "mod3");
TuneCar[vehicleid][mod4] = dini_Int(formatLD, "mod4");
TuneCar[vehicleid][mod5] = dini_Int(formatLD, "mod5");
TuneCar[vehicleid][mod6] = dini_Int(formatLD, "mod6");
TuneCar[vehicleid][mod7] = dini_Int(formatLD, "mod7");
TuneCar[vehicleid][mod8] = dini_Int(formatLD, "mod8");
TuneCar[vehicleid][mod9] = dini_Int(formatLD, "mod9");
TuneCar[vehicleid][mod10] = dini_Int(formatLD, "mod10");
TuneCar[vehicleid][mod11] = dini_Int(formatLD, "mod11");
TuneCar[vehicleid][mod12] = dini_Int(formatLD, "mod12");
TuneCar[vehicleid][mod13] = dini_Int(formatLD, "mod13");
TuneCar[vehicleid][mod14] = dini_Int(formatLD, "mod14");
TuneCar[vehicleid][mod15] = dini_Int(formatLD, "mod15");
TuneCar[vehicleid][mod16] = dini_Int(formatLD, "mod16");
TuneCar[vehicleid][mod17] = dini_Int(formatLD, "mod17");
TuneCar[vehicleid][paintjob] = dini_Int(formatLD, "paintjob");
TuneCar[vehicleid][colorA] = dini_Int(formatLD, "color1");
TuneCar[vehicleid][colorB] = dini_Int(formatLD, "color2");
}
else
{
dini_Create(formatLD);
}
return 0;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):


[FS]Rent
[FS] Vremenska prognoza
[TuT] PayDay
[TuT]PayDay sistem[UPDATED]
Moja Biografija

Respect:Mr.Gagi,FlasH,Streetboy,David (Sabljak) A.k.A SABO(T)
ÄŒovjek nije stvoren za poraze, moze biti unisten, ali ne i pobjeÄ'en!

bump
znali itko?


[FS]Rent
[FS] Vremenska prognoza
[TuT] PayDay
[TuT]PayDay sistem[UPDATED]
Moja Biografija

Respect:Mr.Gagi,FlasH,Streetboy,David (Sabljak) A.k.A SABO(T)
ÄŒovjek nije stvoren za poraze, moze biti unisten, ali ne i pobjeÄ'en!

BUMP!


[FS]Rent
[FS] Vremenska prognoza
[TuT] PayDay
[TuT]PayDay sistem[UPDATED]
Moja Biografija

Respect:Mr.Gagi,FlasH,Streetboy,David (Sabljak) A.k.A SABO(T)
ÄŒovjek nije stvoren za poraze, moze biti unisten, ali ne i pobjeÄ'en!

Moze li pomoc? :/


[FS]Rent
[FS] Vremenska prognoza
[TuT] PayDay
[TuT]PayDay sistem[UPDATED]
Moja Biografija

Respect:Mr.Gagi,FlasH,Streetboy,David (Sabljak) A.k.A SABO(T)
ÄŒovjek nije stvoren za poraze, moze biti unisten, ali ne i pobjeÄ'en!