[Ajuda/Erro]SaveNeon
#4

Chaves..
Verifique e meta as chaves.

@EDIT
Look
Sobrou 3 warnings estou ocupado tente consertб-los.
pawn Код:
#include <a_samp>
#include <dini>
/* TUNING SAVER BY BLACKFOX */
forward TuneThisCar(vehicleid);
forward LoadModsForAll(vehicleid);
forward SaveModsForAll(vehicleid);

new colorA;
new colorB;
new paintjob;

new spoiler[7][0] = {
    {18648},
    {18647},
    {18649},
    {18652},
    {18651},
    {18650},
    {18646}
};

enum tInfo
{
    mod1,
    mod2,
    mod3,
    mod4,
    mod5,
    mod6,
    mod7,
    mod8,
    mod9,
    mod10,
    mod11
}
new TuneCar[MAX_VEHICLES][tInfo];

#define FILTERSCRIPT

#if defined FILTERSCRIPT

public OnFilterScriptInit()
{
    print("\n--------------------------------------");
    print(" BlackFoX's Tuning SaVe");
    print("--------------------------------------\n");
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

#else

main()
{
}

#endif

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    return 1;
}

public OnPlayerRequestSpawn(playerid)
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    return 1;
}

public OnPlayerSpawn(playerid)
{
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    return 1;
}

public OnVehicleSpawn(vehicleid)
{
    return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}

public OnPlayerText(playerid, text[])
{
    return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    return 0;
}

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    LoadModsForAll(vehicleid);
    TuneThisCar(vehicleid);
    return 1;
}

public OnPlayerExitVehicle(playerid, vehicleid)
{
    SaveModsForAll(vehicleid);
    return 1;
}

public OnPlayerStateChange(playerid, newstate, oldstate)
{
    return 1;
}

public OnPlayerEnterCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}

public OnPlayerEnterRaceCheckpoint(playerid)
{
    return 1;
}

public OnPlayerLeaveRaceCheckpoint(playerid)
{
    return 1;
}

public OnRconCommand(cmd[])
{
    return 1;
}

public OnObjectMoved(objectid)
{
    return 1;
}

public OnPlayerObjectMoved(playerid, objectid)
{
    return 1;
}

public OnPlayerPickUpPickup(playerid, pickupid)
{
    return 1;
}

public OnPlayerSelectedMenuRow(playerid, row)
{
    return 1;
}

public OnPlayerExitedMenu(playerid)
{
    return 1;
}
//
public TuneThisCar(vehicleid)
{
        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]); }
        return 1;
}
InitComponents(componentid)
{
    new i;
    for(i=0; i<7; i++)
    {
        if(spoiler[i][0]==componentid)
        {
        return 1;
        }
    }
    return 1;
}

//
public OnVehicleMod(playerid,vehicleid,componentid)
{
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; }
}
printf("Component Added: %d",componentid);
SaveModsForAll(vehicleid);
return 1;
}

public OnVehiclePaintjob(playerid,vehicleid, paintjobid)
{
TuneCar[vehicleid][paintjob] = paintjobid;
return 1;
}
//

public LoadModsForAll(vehicleid)
{
new formatLD[256];
format(formatLD,sizeof(formatLD),"neon_carlist/%d.neonmods",vehicleid);
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");
}
else
{
dini_Create(formatLD);
}
return 0;
}
public SaveModsForAll(vehicleid)
{
new formatLD[256];
format(formatLD,sizeof(formatLD),"neon_carlist/%d.neonmods",vehicleid);
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]);
}
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]);
}
return 0;
}
public OnVehicleRespray(playerid,vehicleid, color1, color2)
{
TuneCar[vehicleid][colorA] = color1;
TuneCar[vehicleid][colorB] = color2;
return 1;
}
Reply


Messages In This Thread
[Ajuda/Erro]SaveNeon - by [Dk]TuReTOo - 15.02.2011, 22:23
Re: [Ajuda/Erro]SaveNeon - by Macintosh - 15.02.2011, 22:32
Re: [Ajuda/Erro]SaveNeon - by [Dk]TuReTOo - 15.02.2011, 22:39
Re: [Ajuda/Erro]SaveNeon - by Macintosh - 15.02.2011, 22:41
Re: [Ajuda/Erro]SaveNeon - by [Dk]TuReTOo - 16.02.2011, 14:07
Re: [Ajuda/Erro]SaveNeon - by Macintosh - 16.02.2011, 16:18
Re: [Ajuda/Erro]SaveNeon - by [Dk]TuReTOo - 16.02.2011, 17:01

Forum Jump:


Users browsing this thread: 2 Guest(s)