[Ajuda] CMD
#1

ola pessoal gostaria de saber como coloco um CMD aqui, pra so salvar o tunning se digitar um comando, tipo /salvartuning

alguйm pode me ajudar?

Код:
#include <a_samp>

forward Starting();
forward ZagruzComponent(vehicleid);
forward ZagruzTuning();
forward SohranTuning();
forward split(const strsrc[], strdest[][], delimiter);
 AntiDeAMX()
    {
    new a[][] =
    {
    "Unarmed (Fist)",
    "Brass K"
    };
    #pragma unused a
    }

new AvtoModification[MAX_VEHICLES][11];


public OnFilterScriptInit()
{
    ZagruzTuning();
    SetTimer("Starting", 10000, 0);
	return 1;
}


public ZagruzComponent(vehicleid)
{
    if(AvtoModification[vehicleid][0] >= 1000 && AvtoModification[vehicleid][0] <= 1193)
	{
	    if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(AvtoModification[vehicleid][0])) != AvtoModification[vehicleid][0])
        {
            AddVehicleComponent(vehicleid,AvtoModification[vehicleid][0]);
        }
	}
	if(AvtoModification[vehicleid][1] >= 1000 && AvtoModification[vehicleid][1] <= 1193)
	{
	    if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(AvtoModification[vehicleid][1])) != AvtoModification[vehicleid][1])
        {
            AddVehicleComponent(vehicleid,AvtoModification[vehicleid][1]);
        }
	}
	if(AvtoModification[vehicleid][2] >= 1000 && AvtoModification[vehicleid][2] <= 1193)
	{
	    if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(AvtoModification[vehicleid][2])) != AvtoModification[vehicleid][2])
        {
            AddVehicleComponent(vehicleid,AvtoModification[vehicleid][2]);
        }
	}
	if(AvtoModification[vehicleid][3] >= 1000 && AvtoModification[vehicleid][3] <= 1193)
	{
	    if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(AvtoModification[vehicleid][3])) != AvtoModification[vehicleid][3])
        {
            AddVehicleComponent(vehicleid,AvtoModification[vehicleid][3]);
        }
	}
	if(AvtoModification[vehicleid][4] >= 1000 && AvtoModification[vehicleid][4] <= 1193)
	{
	    if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(AvtoModification[vehicleid][4])) != AvtoModification[vehicleid][4])
        {
            AddVehicleComponent(vehicleid,AvtoModification[vehicleid][4]);
        }
	}
	if(AvtoModification[vehicleid][5] >= 1000 && AvtoModification[vehicleid][5] <= 1193)
	{
	    if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(AvtoModification[vehicleid][5])) != AvtoModification[vehicleid][5])
        {
            AddVehicleComponent(vehicleid,AvtoModification[vehicleid][5]);
        }
	}
	if(AvtoModification[vehicleid][6] >= 1000 && AvtoModification[vehicleid][6] <= 1193)
	{
	    if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(AvtoModification[vehicleid][6])) != AvtoModification[vehicleid][6])
        {
            AddVehicleComponent(vehicleid,AvtoModification[vehicleid][6]);
        }
	}
	if(AvtoModification[vehicleid][7] >= 1000 && AvtoModification[vehicleid][7] <= 1193)
	{
	    if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(AvtoModification[vehicleid][7])) != AvtoModification[vehicleid][7])
        {
            AddVehicleComponent(vehicleid,AvtoModification[vehicleid][7]);
        }
	}
	if(AvtoModification[vehicleid][8] >= 1000 && AvtoModification[vehicleid][8] <= 1193)
	{
	    if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(AvtoModification[vehicleid][8])) != AvtoModification[vehicleid][8])
        {
            AddVehicleComponent(vehicleid,AvtoModification[vehicleid][8]);
        }
	}
	if(AvtoModification[vehicleid][9] >= 1000 && AvtoModification[vehicleid][9] <= 1193)
	{
	    if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(AvtoModification[vehicleid][9])) != AvtoModification[vehicleid][9])
        {
            AddVehicleComponent(vehicleid,AvtoModification[vehicleid][9]);
        }
	}
    if(AvtoModification[vehicleid][10] > 0)
	{
	    ChangeVehiclePaintjob(vehicleid,AvtoModification[vehicleid][10]);
	}
	return 1;
}



public Starting()
{
    for(new v = 0; v < MAX_VEHICLES; v++)
    {
        ZagruzComponent(v);
    }
}
public OnPlayerConnect(playerid)
{
SendClientMessage(playerid,0xFFFFFF96,"На сервере установлена система сохранения тюнинга ");
SendClientMessage(playerid,0xFFFFFF96,"By Pawn-Script.ru ");
}
public OnVehicleSpawn(vehicleid)
{
    ZagruzComponent(vehicleid);
	return 1;
}

public OnVehicleMod(playerid,vehicleid,componentid)
{
    AntiDeAMX();
	SohranTuning();

	if(AvtoModification[vehicleid][0] == 0)
	{
	    AvtoModification[vehicleid][0] = componentid;
	}
	else if(AvtoModification[vehicleid][1] == 0)
	{
	    AvtoModification[vehicleid][1] = componentid;
	}
	else if(AvtoModification[vehicleid][2] == 0)
	{
	    AvtoModification[vehicleid][2] = componentid;
	}
	else if(AvtoModification[vehicleid][3] == 0)
	{
	    AvtoModification[vehicleid][3] = componentid;
	}
	else if(AvtoModification[vehicleid][4] == 0)
	{
	    AvtoModification[vehicleid][4] = componentid;
	}
	else if(AvtoModification[vehicleid][5] == 0)
	{
	    AvtoModification[vehicleid][5] = componentid;
	}
	else if(AvtoModification[vehicleid][6] == 0)
	{
	    AvtoModification[vehicleid][6] = componentid;
	}
	else if(AvtoModification[vehicleid][7] == 0)
	{
	    AvtoModification[vehicleid][7] = componentid;
	}
	else if(AvtoModification[vehicleid][8] == 0)
	{
	    AvtoModification[vehicleid][8] = componentid;
	}
	else if(AvtoModification[vehicleid][9] == 0)
	{
	    AvtoModification[vehicleid][9] = componentid;
	}
	else
	{
		SendClientMessage(playerid,0xFFFFFF96,"У тебя уже есть этот компонент");
	}
    return 1;
}

public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
{
    AvtoModification[vehicleid][10] = paintjobid;
	return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
	new cmd[256];
	new idx;
	cmd = strtok(cmdtext, idx);

    if(strcmp("/удалитьнахуй",cmd,true)==0)
    {
        if (!IsPlayerInAnyVehicle(playerid))
        {
            SendClientMessage(playerid,0xFFFFFF96,"Ты не в авто.");
            return 1;
        }
   	    new vehicleid = GetPlayerVehicleID(playerid);
	    if(AvtoModification[vehicleid][0] > 0)
	    {
	        AvtoModification[vehicleid][0] = 0;
	        AvtoModification[vehicleid][1] = 0;
	        AvtoModification[vehicleid][2] = 0;
	        AvtoModification[vehicleid][3] = 0;
	        AvtoModification[vehicleid][4] = 0;
	        AvtoModification[vehicleid][5] = 0;
	        AvtoModification[vehicleid][6] = 0;
	        AvtoModification[vehicleid][7] = 0;
	        AvtoModification[vehicleid][8] = 0;
	        AvtoModification[vehicleid][9] = 0;
	        AvtoModification[vehicleid][10] = 0;
	        SendClientMessage(playerid,0xFFFFFF96,"Тюнинг успешно удален.");
    	    SetVehicleToRespawn(vehicleid);
	        return 1;
	    }
	    else
	    {
	        SendClientMessage(playerid,0xFFFFFF96,"Нету!!!.");
	    }
        return 1;
	}

	return 0;
}
///   Не Забудьте добавить tuning.cfg   в скриптфайлс     А СКРИПТ ЖЕЛАТЕЛЬНО ВПИСЫВАТЬ В МОД!!! УДАЧИ В ПОЛЬЗОВАНИИ   Misha_Konsta
public ZagruzTuning()
{
	new arrCoords[11][64];
	new strFromFile2[256];
	new File: file = fopen("tuning.cfg", io_read);
	if (file)
	{
		new idx;
		while((idx < MAX_VEHICLES))
		{
			fread(file, strFromFile2);
			split(strFromFile2, arrCoords, '|');
			AvtoModification[idx][0] = strval(arrCoords[0]);
		    AvtoModification[idx][1] = strval(arrCoords[1]);
		    AvtoModification[idx][2] = strval(arrCoords[2]);
		    AvtoModification[idx][3] = strval(arrCoords[3]);
		    AvtoModification[idx][4] = strval(arrCoords[4]);
		    AvtoModification[idx][5] = strval(arrCoords[5]);
		    AvtoModification[idx][6] = strval(arrCoords[6]);
		    AvtoModification[idx][7] = strval(arrCoords[7]);
		    AvtoModification[idx][8] = strval(arrCoords[8]);
		    AvtoModification[idx][9] = strval(arrCoords[9]);
		    AvtoModification[idx][10] = strval(arrCoords[10]);
			idx++;
		}
		fclose(file);
	}
	return 1;
}
///   Не Забудьте добавить tuning.cfg   в скриптфайлс     А СКРИПТ ЖЕЛАТЕЛЬНО ВПИСЫВАТЬ В МОД!!! УДАЧИ В ПОЛЬЗОВАНИИ   Misha_Konsta
public SohranTuning()
{
	new idx;
	new File: file2;
	while((idx < MAX_VEHICLES))
	{
		new coordsstring[256];
		format(coordsstring, sizeof(coordsstring), "%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
		AvtoModification[idx][0],
		AvtoModification[idx][1],
		AvtoModification[idx][2],
		AvtoModification[idx][3],
		AvtoModification[idx][4],
		AvtoModification[idx][5],
		AvtoModification[idx][6],
		AvtoModification[idx][7],
		AvtoModification[idx][8],
		AvtoModification[idx][9],
		AvtoModification[idx][10]);
		if(idx == 0)
		{
			file2 = fopen("tuning.cfg", io_write);
		}
		else
		{
			file2 = fopen("tuning.cfg", io_append);
		}
		fwrite(file2, coordsstring);
		idx++;
		fclose(file2);
	}
	return 1;
}

stock PointOverString(string[], argument, schar)
{
	new length = strlen(string), arg, result[128], index;
	for (new i = 0; i < length; i++)
	{
		if (string[i] == schar || i == length || string[i + 1] == 10)
		{
			arg++;
			if (arg == argument + 1)
			{
				result[i-index] = EOS;
				return result;
			}
			else if (arg == argument)
			index = i+1;
		}
		else if (arg == argument)
		result[i - index] = string[i];
	}
	return result;
}

public split(const strsrc[], strdest[][], delimiter)
{
	new i, li;
	new aNum;
	new len;
	while(i <= strlen(strsrc)){
	    if(strsrc[i]==delimiter || i==strlen(strsrc)){
	        len = strmid(strdest[aNum], strsrc, li, i, 128);
	        strdest[aNum][len] = 0;
	        li = i+1;
	        aNum++;
		}
		i++;
	}
	return 1;
}

strtok(const string[], &index)
{
	new length = strlen(string);
	while ((index < length) && (string[index] <= ' '))
	{
		index++;
	}

	new offset = index;
	new result[20];
	while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
	{
		result[index - offset] = string[index];
		index++;
	}
	result[index - offset] = EOS;
	return result;
}
///   Не Забудьте добавить tuning.cfg   в скриптфайлс     А СКРИПТ ЖЕЛАТЕЛЬНО ВПИСЫВАТЬ В МОД!!! УДАЧИ В ПОЛЬЗОВАНИИ   Misha_Konsta
Reply
#2

Tens de fazer um sistema de salvamento, coisa que ai nao tens.
Reply
#3

ele ta salvando aqui.

new File: file = fopen("tuning.cfg", io_read);
Reply
#4

Isso ta em russo ou que porra й essa tem ai em portugues e ate mesmo em ingles.
Melhor coisa que poderas fazer й fazer um tu mesmo adaptado para o teu sistema de salvamento.
Reply
#5

Код:
#include <a_samp>
#include <DOF2>


#define FILTERSCRIPT

#if defined FILTERSCRIPT

#define FILTERSCRIPT

forward TuneThisCar(vehicleid);
forward LoadModsForAll(vehicleid);
forward SaveModsForAll(vehicleid);
forward VehicleSpawn (vehicleid);
forward RestartVeh(vehicleid);
forward Timermods();

new spoiler[20][0] = {
	{1000},
	{1001},
	{1002},
	{1003},
	{1014},
	{1015},
	{1016},
	{1023},
	{1058},
	{1060},
	{1049},
	{1050},
	{1138},
	{1139},
	{1146},
	{1147},
	{1158},
	{1162},
	{1163},
	{1164}
};

new nitro[3][0] = {
	{1008},
	{1009},
	{1010}
};

new fbumper[23][0] = {
	{1117},
	{1152},
	{1153},
	{1155},
	{1157},
	{1160},
	{1165},
	{1167},
	{1169},
	{1170},
	{1171},
	{1172},
	{1173},
	{1174},
	{1175},
	{1179},
	{1181},
	{1182},
	{1185},
	{1188},
	{1189},
	{1192},
	{1193}
};

new rbumper[22][0] = {
	{1140},
	{1141},
	{1148},
	{1149},
	{1150},
	{1151},
	{1154},
	{1156},
	{1159},
	{1161},
	{1166},
	{1168},
	{1176},
	{1177},
	{1178},
	{1180},
	{1183},
	{1184},
	{1186},
	{1187},
	{1190},
	{1191}
};

new exhaust[28][0] = {
	{1018},
	{1019},
	{1020},
	{1021},
	{1022},
	{1028},
	{1029},
	{1037},
	{1043},
	{1044},
	{1045},
	{1046},
	{1059},
	{1064},
	{1065},
	{1066},
	{1089},
	{1092},
	{1104},
	{1105},
	{1113},
	{1114},
	{1126},
	{1127},
	{1129},
	{1132},
	{1135},
	{1136}
};

new bventr[2][0] = {
	{1042},
	{1044}
};

new bventl[2][0] = {
	{1043},
	{1045}
};

new bscoop[4][0] = {
	{1004},
	{1005},
	{1011},
	{1012}
};

new rscoop[13][0] = {
	{1006},
	{1032},
	{1033},
	{1035},
	{1038},
	{1053},
	{1054},
	{1055},
	{1061},
	{1067},
	{1068},
	{1088},
	{1091}
};

new lskirt[21][0] = {
	{1007},
	{1026},
	{1031},
	{1036},
	{1039},
	{1042},
	{1047},
	{1048},
	{1056},
	{1057},
	{1069},
	{1070},
	{1090},
	{1093},
	{1106},
	{1108},
	{1118},
	{1119},
	{1133},
	{1122},
	{1134}
};

new rskirt[21][0] = {
	{1017},
	{1027},
	{1030},
	{1040},
	{1041},
	{1051},
	{1052},
	{1062},
	{1063},
	{1071},
	{1072},
	{1094},
	{1095},
	{1099},
	{1101},
	{1102},
	{1107},
	{1120},
	{1121},
	{1124},
	{1137}
};

new hydraulics[1][0] = {
	{1087}
};

new base[1][0] = {
	{1086}
};

new rbbars[2][0] = {
	{1109},
	{1110}
};

new fbbars[2][0] = {
	{1115},
	{1116}
};

new wheels[17][0] = {
	{1025},
	{1073},
	{1074},
	{1075},
	{1076},
	{1077},
	{1078},
	{1079},
	{1080},
	{1081},
	{1082},
	{1083},
	{1084},
	{1085},
	{1096},
	{1097},
	{1098}
};

new lights[2][0] = {
	{1013},
	{1024}
};
//
enum tInfo
{
	mod1,
	mod2,
	mod3,
	mod4,
	mod5,
	mod6,
	mod7,
	mod8,
	mod9,
	mod10,
	mod11,
	mod12,
	mod13,
	mod14,
	mod15,
	mod16,
	mod17,
	paintjob,
	colorA,
	colorB,
}
new TuneCar[MAX_VEHICLES][tInfo];

public OnFilterScriptExit()
{
    DOF2_Exit();
	return 1;
}

#endif
public OnVehicleSpawn(vehicleid)
{
	SetTimer("VehicleSpawn",2000,0);
}

public OnVehicleDeath(vehicleid, killerid)
{
	SaveModsForAll(vehicleid);
	return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
	SaveModsForAll(vehicleid);
	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]); }
	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;
}
InitComponents(componentid)
{
	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(lights[i][0]==componentid) { return 17; }
	}
	return 0;
}
//
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; }
		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("Composant Ajouter: %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),"Tunados/%d.mods",vehicleid);
	if(DOF2_FileExists(formatLD))
	{
		TuneCar[vehicleid][mod1] = DOF2_GetInt(formatLD, "mod1");
		TuneCar[vehicleid][mod2] = DOF2_GetInt(formatLD, "mod2");
		TuneCar[vehicleid][mod3] = DOF2_GetInt(formatLD, "mod3");
		TuneCar[vehicleid][mod4] = DOF2_GetInt(formatLD, "mod4");
		TuneCar[vehicleid][mod5] = DOF2_GetInt(formatLD, "mod5");

		TuneCar[vehicleid][mod6] = DOF2_GetInt(formatLD, "mod6");
		TuneCar[vehicleid][mod7] = DOF2_GetInt(formatLD, "mod7");
		TuneCar[vehicleid][mod8] = DOF2_GetInt(formatLD, "mod8");
		TuneCar[vehicleid][mod9] = DOF2_GetInt(formatLD, "mod9");
		TuneCar[vehicleid][mod10] = DOF2_GetInt(formatLD, "mod10");

		TuneCar[vehicleid][mod11] = DOF2_GetInt(formatLD, "mod11");
		TuneCar[vehicleid][mod12] = DOF2_GetInt(formatLD, "mod12");
		TuneCar[vehicleid][mod13] = DOF2_GetInt(formatLD, "mod13");
		TuneCar[vehicleid][mod14] = DOF2_GetInt(formatLD, "mod14");
		TuneCar[vehicleid][mod15] = DOF2_GetInt(formatLD, "mod15");

		TuneCar[vehicleid][mod16] = DOF2_GetInt(formatLD, "mod16");
		TuneCar[vehicleid][mod17] = DOF2_GetInt(formatLD, "mod17");
		TuneCar[vehicleid][paintjob] = DOF2_GetInt(formatLD, "paintjob");
		TuneCar[vehicleid][colorA] = DOF2_GetInt(formatLD, "color1");
		TuneCar[vehicleid][colorB] = DOF2_GetInt(formatLD, "color2");
	}
	else
	{
		DOF2_CreateFile(formatLD);
	}
	return 0;
}
public SaveModsForAll(vehicleid)
{
	new formatLD[256];
	format(formatLD,sizeof(formatLD),"Tunados/%d.mods",vehicleid);
	if(DOF2_FileExists(formatLD))
	{
		DOF2_SetInt(formatLD,"mod1",TuneCar[vehicleid][mod1]);
		DOF2_SetInt(formatLD,"mod2",TuneCar[vehicleid][mod2]);
		DOF2_SetInt(formatLD,"mod3",TuneCar[vehicleid][mod3]);
		DOF2_SetInt(formatLD,"mod4",TuneCar[vehicleid][mod4]);
		DOF2_SetInt(formatLD,"mod5",TuneCar[vehicleid][mod5]);
		DOF2_SetInt(formatLD,"mod6",TuneCar[vehicleid][mod6]);
		DOF2_SetInt(formatLD,"mod7",TuneCar[vehicleid][mod8]);
		DOF2_SetInt(formatLD,"mod9",TuneCar[vehicleid][mod9]);
		DOF2_SetInt(formatLD,"mod10",TuneCar[vehicleid][mod10]);
		DOF2_SetInt(formatLD,"mod11",TuneCar[vehicleid][mod11]);
		DOF2_SetInt(formatLD,"mod12",TuneCar[vehicleid][mod12]);
		DOF2_SetInt(formatLD,"mod13",TuneCar[vehicleid][mod13]);
		DOF2_SetInt(formatLD,"mod14",TuneCar[vehicleid][mod14]);
		DOF2_SetInt(formatLD,"mod15",TuneCar[vehicleid][mod15]);
		DOF2_SetInt(formatLD,"mod16",TuneCar[vehicleid][mod16]);
		DOF2_SetInt(formatLD,"mod17",TuneCar[vehicleid][mod17]);
		DOF2_SetInt(formatLD,"paintjob",TuneCar[vehicleid][paintjob]);
		DOF2_SetInt(formatLD,"color1",TuneCar[vehicleid][colorA]);
		DOF2_SetInt(formatLD,"color2",TuneCar[vehicleid][colorB]);
	}
	else
	{
		DOF2_CreateFile(formatLD);
		DOF2_SetInt(formatLD,"mod1",TuneCar[vehicleid][mod1]);
		DOF2_SetInt(formatLD,"mod2",TuneCar[vehicleid][mod2]);
		DOF2_SetInt(formatLD,"mod3",TuneCar[vehicleid][mod3]);
		DOF2_SetInt(formatLD,"mod4",TuneCar[vehicleid][mod4]);
		DOF2_SetInt(formatLD,"mod5",TuneCar[vehicleid][mod5]);
		DOF2_SetInt(formatLD,"mod6",TuneCar[vehicleid][mod6]);
		DOF2_SetInt(formatLD,"mod7",TuneCar[vehicleid][mod8]);
		DOF2_SetInt(formatLD,"mod9",TuneCar[vehicleid][mod9]);
		DOF2_SetInt(formatLD,"mod10",TuneCar[vehicleid][mod10]);
		DOF2_SetInt(formatLD,"mod11",TuneCar[vehicleid][mod11]);
		DOF2_SetInt(formatLD,"mod12",TuneCar[vehicleid][mod12]);
		DOF2_SetInt(formatLD,"mod13",TuneCar[vehicleid][mod13]);
		DOF2_SetInt(formatLD,"mod14",TuneCar[vehicleid][mod14]);
		DOF2_SetInt(formatLD,"mod15",TuneCar[vehicleid][mod15]);
		DOF2_SetInt(formatLD,"mod16",TuneCar[vehicleid][mod16]);
		DOF2_SetInt(formatLD,"mod17",TuneCar[vehicleid][mod17]);
		DOF2_SetInt(formatLD,"paintjob",TuneCar[vehicleid][paintjob]);
		DOF2_SetInt(formatLD,"color1",TuneCar[vehicleid][colorA]);
		DOF2_SetInt(formatLD,"color2",TuneCar[vehicleid][colorB]);
	}
	return 0;
}
public OnVehicleRespray(playerid,vehicleid, color1, color2)
{
	TuneCar[vehicleid][colorA] = color1;
	TuneCar[vehicleid][colorB] = color2;
	return 1;
}
public VehicleSpawn(vehicleid)
{
	TuneThisCar(vehicleid);
	LoadModsForAll(vehicleid);
	return 1;
}
melhorou?

agora como faзo um comando para salvar sу os carros que quero?
Reply
#6

Use a public

pawn Код:
public SaveModsForAll(vehicleid)
No seu comando.
Reply
#7

jб tem, e o porem nгo e isso oque eu quero saber e como coloco um comando que sу ai ele salva o tuning, tipo /savartuning
Reply
#8

Recomendo que vocк troque Tunados/%d.mods por Tunados/%d.ini

pawn Код:
if(strcmp(cmd, "/salvartuning", true) == 0)
{
if(IsPlayerInAnyVehicle(playerid)) {
SaveModsForAll(GetPlayerVehicleID(playerid));
SendClientMessage(playerid, 0xFFFFFFAA, "Tuning Salvo.");
}
return 1;
}

pawn Код:
public SaveModsForAll(vehicleid)
{
    new formatLD[256];
    format(formatLD,sizeof(formatLD),"Tunados/%d.mods",vehicleid);
    if(DOF2_FileExists(formatLD))
    {
        DOF2_SetInt(formatLD,"mod1",TuneCar[vehicleid][mod1]);
        DOF2_SetInt(formatLD,"mod2",TuneCar[vehicleid][mod2]);
        DOF2_SetInt(formatLD,"mod3",TuneCar[vehicleid][mod3]);
        DOF2_SetInt(formatLD,"mod4",TuneCar[vehicleid][mod4]);
        DOF2_SetInt(formatLD,"mod5",TuneCar[vehicleid][mod5]);
        DOF2_SetInt(formatLD,"mod6",TuneCar[vehicleid][mod6]);
        DOF2_SetInt(formatLD,"mod7",TuneCar[vehicleid][mod8]);
        DOF2_SetInt(formatLD,"mod9",TuneCar[vehicleid][mod9]);
        DOF2_SetInt(formatLD,"mod10",TuneCar[vehicleid][mod10]);
        DOF2_SetInt(formatLD,"mod11",TuneCar[vehicleid][mod11]);
        DOF2_SetInt(formatLD,"mod12",TuneCar[vehicleid][mod12]);
        DOF2_SetInt(formatLD,"mod13",TuneCar[vehicleid][mod13]);
        DOF2_SetInt(formatLD,"mod14",TuneCar[vehicleid][mod14]);
        DOF2_SetInt(formatLD,"mod15",TuneCar[vehicleid][mod15]);
        DOF2_SetInt(formatLD,"mod16",TuneCar[vehicleid][mod16]);
        DOF2_SetInt(formatLD,"mod17",TuneCar[vehicleid][mod17]);
        DOF2_SetInt(formatLD,"paintjob",TuneCar[vehicleid][paintjob]);
        DOF2_SetInt(formatLD,"color1",TuneCar[vehicleid][colorA]);
        DOF2_SetInt(formatLD,"color2",TuneCar[vehicleid][colorB]);
                DOF2_SaveFile();
        }
    else
    {
        DOF2_CreateFile(formatLD);
        DOF2_SetInt(formatLD,"mod1",TuneCar[vehicleid][mod1]);
        DOF2_SetInt(formatLD,"mod2",TuneCar[vehicleid][mod2]);
        DOF2_SetInt(formatLD,"mod3",TuneCar[vehicleid][mod3]);
        DOF2_SetInt(formatLD,"mod4",TuneCar[vehicleid][mod4]);
        DOF2_SetInt(formatLD,"mod5",TuneCar[vehicleid][mod5]);
        DOF2_SetInt(formatLD,"mod6",TuneCar[vehicleid][mod6]);
        DOF2_SetInt(formatLD,"mod7",TuneCar[vehicleid][mod8]);
        DOF2_SetInt(formatLD,"mod9",TuneCar[vehicleid][mod9]);
        DOF2_SetInt(formatLD,"mod10",TuneCar[vehicleid][mod10]);
        DOF2_SetInt(formatLD,"mod11",TuneCar[vehicleid][mod11]);
        DOF2_SetInt(formatLD,"mod12",TuneCar[vehicleid][mod12]);
        DOF2_SetInt(formatLD,"mod13",TuneCar[vehicleid][mod13]);
        DOF2_SetInt(formatLD,"mod14",TuneCar[vehicleid][mod14]);
        DOF2_SetInt(formatLD,"mod15",TuneCar[vehicleid][mod15]);
        DOF2_SetInt(formatLD,"mod16",TuneCar[vehicleid][mod16]);
        DOF2_SetInt(formatLD,"mod17",TuneCar[vehicleid][mod17]);
        DOF2_SetInt(formatLD,"paintjob",TuneCar[vehicleid][paintjob]);
        DOF2_SetInt(formatLD,"color1",TuneCar[vehicleid][colorA]);
        DOF2_SetInt(formatLD,"color2",TuneCar[vehicleid][colorB]);
                DOF2_SaveFile();
        }
    return 0;
}
Reply
#9

ele ta ate gravando na pasta tunados, sу que o carro explode ou e respawnado e ele volta ao normal:

Код:
#include <a_samp>
#include <DOF2>
#include <zcmd>

#define FILTERSCRIPT

#if defined FILTERSCRIPT

#define FILTERSCRIPT

forward TuneThisCar(vehicleid);
forward LoadModsForAll(vehicleid);
forward SaveModsForAll(vehicleid);
forward VehicleSpawn (vehicleid);
forward RestartVeh(vehicleid);
forward Timermods();

new spoiler[20][0] = {
	{1000},
	{1001},
	{1002},
	{1003},
	{1014},
	{1015},
	{1016},
	{1023},
	{1058},
	{1060},
	{1049},
	{1050},
	{1138},
	{1139},
	{1146},
	{1147},
	{1158},
	{1162},
	{1163},
	{1164}
};

new nitro[3][0] = {
	{1008},
	{1009},
	{1010}
};

new fbumper[23][0] = {
	{1117},
	{1152},
	{1153},
	{1155},
	{1157},
	{1160},
	{1165},
	{1167},
	{1169},
	{1170},
	{1171},
	{1172},
	{1173},
	{1174},
	{1175},
	{1179},
	{1181},
	{1182},
	{1185},
	{1188},
	{1189},
	{1192},
	{1193}
};

new rbumper[22][0] = {
	{1140},
	{1141},
	{1148},
	{1149},
	{1150},
	{1151},
	{1154},
	{1156},
	{1159},
	{1161},
	{1166},
	{1168},
	{1176},
	{1177},
	{1178},
	{1180},
	{1183},
	{1184},
	{1186},
	{1187},
	{1190},
	{1191}
};

new exhaust[28][0] = {
	{1018},
	{1019},
	{1020},
	{1021},
	{1022},
	{1028},
	{1029},
	{1037},
	{1043},
	{1044},
	{1045},
	{1046},
	{1059},
	{1064},
	{1065},
	{1066},
	{1089},
	{1092},
	{1104},
	{1105},
	{1113},
	{1114},
	{1126},
	{1127},
	{1129},
	{1132},
	{1135},
	{1136}
};

new bventr[2][0] = {
	{1042},
	{1044}
};

new bventl[2][0] = {
	{1043},
	{1045}
};

new bscoop[4][0] = {
	{1004},
	{1005},
	{1011},
	{1012}
};

new rscoop[13][0] = {
	{1006},
	{1032},
	{1033},
	{1035},
	{1038},
	{1053},
	{1054},
	{1055},
	{1061},
	{1067},
	{1068},
	{1088},
	{1091}
};

new lskirt[21][0] = {
	{1007},
	{1026},
	{1031},
	{1036},
	{1039},
	{1042},
	{1047},
	{1048},
	{1056},
	{1057},
	{1069},
	{1070},
	{1090},
	{1093},
	{1106},
	{1108},
	{1118},
	{1119},
	{1133},
	{1122},
	{1134}
};

new rskirt[21][0] = {
	{1017},
	{1027},
	{1030},
	{1040},
	{1041},
	{1051},
	{1052},
	{1062},
	{1063},
	{1071},
	{1072},
	{1094},
	{1095},
	{1099},
	{1101},
	{1102},
	{1107},
	{1120},
	{1121},
	{1124},
	{1137}
};

new hydraulics[1][0] = {
	{1087}
};

new base[1][0] = {
	{1086}
};

new rbbars[2][0] = {
	{1109},
	{1110}
};

new fbbars[2][0] = {
	{1115},
	{1116}
};

new wheels[17][0] = {
	{1025},
	{1073},
	{1074},
	{1075},
	{1076},
	{1077},
	{1078},
	{1079},
	{1080},
	{1081},
	{1082},
	{1083},
	{1084},
	{1085},
	{1096},
	{1097},
	{1098}
};

new lights[2][0] = {
	{1013},
	{1024}
};
//
enum tInfo
{
	mod1,
	mod2,
	mod3,
	mod4,
	mod5,
	mod6,
	mod7,
	mod8,
	mod9,
	mod10,
	mod11,
	mod12,
	mod13,
	mod14,
	mod15,
	mod16,
	mod17,
	paintjob,
	colorA,
	colorB,
}
new TuneCar[MAX_VEHICLES][tInfo];

public OnFilterScriptExit()
{
    DOF2_Exit();
	return 1;
}

#endif
public OnVehicleSpawn(vehicleid)
{
	SetTimer("VehicleSpawn",2000,0);
}

public OnVehicleDeath(vehicleid, killerid)
{
	SaveModsForAll(vehicleid);
	return 1;
}
public OnPlayerExitVehicle(playerid, vehicleid)
{
	SaveModsForAll(vehicleid);
	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]); }
	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;
}
InitComponents(componentid)
{
	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(lights[i][0]==componentid) { return 17; }
	}
	return 0;
}
//
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; }
		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("Composant Ajouter: %d",componentid);
	SaveModsForAll(vehicleid);
	return 1;
}

public OnVehiclePaintjob(playerid,vehicleid, paintjobid)
{
	TuneCar[vehicleid][paintjob]=paintjobid;
	return 1;
}
//
CMD:salvartuning(playerid, params[])
{
	if(IsPlayerInAnyVehicle(playerid)) {
		SaveModsForAll(GetPlayerVehicleID(playerid));
		SendClientMessage(playerid, 0xFFFFFFAA, "Tuning Salvo.");
	}
	return 1;
}
public LoadModsForAll(vehicleid)
{
	new formatLD[256];
	format(formatLD,sizeof(formatLD),"Tunados/%d.ini",vehicleid);
	if(DOF2_FileExists(formatLD))
	{
		TuneCar[vehicleid][mod1] = DOF2_GetInt(formatLD, "mod1");
		TuneCar[vehicleid][mod2] = DOF2_GetInt(formatLD, "mod2");
		TuneCar[vehicleid][mod3] = DOF2_GetInt(formatLD, "mod3");
		TuneCar[vehicleid][mod4] = DOF2_GetInt(formatLD, "mod4");
		TuneCar[vehicleid][mod5] = DOF2_GetInt(formatLD, "mod5");

		TuneCar[vehicleid][mod6] = DOF2_GetInt(formatLD, "mod6");
		TuneCar[vehicleid][mod7] = DOF2_GetInt(formatLD, "mod7");
		TuneCar[vehicleid][mod8] = DOF2_GetInt(formatLD, "mod8");
		TuneCar[vehicleid][mod9] = DOF2_GetInt(formatLD, "mod9");
		TuneCar[vehicleid][mod10] = DOF2_GetInt(formatLD, "mod10");

		TuneCar[vehicleid][mod11] = DOF2_GetInt(formatLD, "mod11");
		TuneCar[vehicleid][mod12] = DOF2_GetInt(formatLD, "mod12");
		TuneCar[vehicleid][mod13] = DOF2_GetInt(formatLD, "mod13");
		TuneCar[vehicleid][mod14] = DOF2_GetInt(formatLD, "mod14");
		TuneCar[vehicleid][mod15] = DOF2_GetInt(formatLD, "mod15");

		TuneCar[vehicleid][mod16] = DOF2_GetInt(formatLD, "mod16");
		TuneCar[vehicleid][mod17] = DOF2_GetInt(formatLD, "mod17");
		TuneCar[vehicleid][paintjob] = DOF2_GetInt(formatLD, "paintjob");
		TuneCar[vehicleid][colorA] = DOF2_GetInt(formatLD, "color1");
		TuneCar[vehicleid][colorB] = DOF2_GetInt(formatLD, "color2");
	}
	else
	{
		DOF2_CreateFile(formatLD);
	}
	return 0;
}
public SaveModsForAll(vehicleid)
{
	new formatLD[256];
	format(formatLD,sizeof(formatLD),"Tunados/%d.ini",vehicleid);
	if(DOF2_FileExists(formatLD))
	{
		DOF2_SetInt(formatLD,"mod1",TuneCar[vehicleid][mod1]);
		DOF2_SetInt(formatLD,"mod2",TuneCar[vehicleid][mod2]);
		DOF2_SetInt(formatLD,"mod3",TuneCar[vehicleid][mod3]);
		DOF2_SetInt(formatLD,"mod4",TuneCar[vehicleid][mod4]);
		DOF2_SetInt(formatLD,"mod5",TuneCar[vehicleid][mod5]);
		DOF2_SetInt(formatLD,"mod6",TuneCar[vehicleid][mod6]);
		DOF2_SetInt(formatLD,"mod7",TuneCar[vehicleid][mod8]);
		DOF2_SetInt(formatLD,"mod9",TuneCar[vehicleid][mod9]);
		DOF2_SetInt(formatLD,"mod10",TuneCar[vehicleid][mod10]);
		DOF2_SetInt(formatLD,"mod11",TuneCar[vehicleid][mod11]);
		DOF2_SetInt(formatLD,"mod12",TuneCar[vehicleid][mod12]);
		DOF2_SetInt(formatLD,"mod13",TuneCar[vehicleid][mod13]);
		DOF2_SetInt(formatLD,"mod14",TuneCar[vehicleid][mod14]);
		DOF2_SetInt(formatLD,"mod15",TuneCar[vehicleid][mod15]);
		DOF2_SetInt(formatLD,"mod16",TuneCar[vehicleid][mod16]);
		DOF2_SetInt(formatLD,"mod17",TuneCar[vehicleid][mod17]);
		DOF2_SetInt(formatLD,"paintjob",TuneCar[vehicleid][paintjob]);
		DOF2_SetInt(formatLD,"color1",TuneCar[vehicleid][colorA]);
		DOF2_SetInt(formatLD,"color2",TuneCar[vehicleid][colorB]);
        DOF2_SaveFile();
        }
	    else
	    {
		DOF2_CreateFile(formatLD);
		DOF2_SetInt(formatLD,"mod1",TuneCar[vehicleid][mod1]);
		DOF2_SetInt(formatLD,"mod2",TuneCar[vehicleid][mod2]);
		DOF2_SetInt(formatLD,"mod3",TuneCar[vehicleid][mod3]);
		DOF2_SetInt(formatLD,"mod4",TuneCar[vehicleid][mod4]);
		DOF2_SetInt(formatLD,"mod5",TuneCar[vehicleid][mod5]);
		DOF2_SetInt(formatLD,"mod6",TuneCar[vehicleid][mod6]);
		DOF2_SetInt(formatLD,"mod7",TuneCar[vehicleid][mod8]);
		DOF2_SetInt(formatLD,"mod9",TuneCar[vehicleid][mod9]);
		DOF2_SetInt(formatLD,"mod10",TuneCar[vehicleid][mod10]);
		DOF2_SetInt(formatLD,"mod11",TuneCar[vehicleid][mod11]);
		DOF2_SetInt(formatLD,"mod12",TuneCar[vehicleid][mod12]);
		DOF2_SetInt(formatLD,"mod13",TuneCar[vehicleid][mod13]);
		DOF2_SetInt(formatLD,"mod14",TuneCar[vehicleid][mod14]);
		DOF2_SetInt(formatLD,"mod15",TuneCar[vehicleid][mod15]);
		DOF2_SetInt(formatLD,"mod16",TuneCar[vehicleid][mod16]);
		DOF2_SetInt(formatLD,"mod17",TuneCar[vehicleid][mod17]);
		DOF2_SetInt(formatLD,"paintjob",TuneCar[vehicleid][paintjob]);
		DOF2_SetInt(formatLD,"color1",TuneCar[vehicleid][colorA]);
		DOF2_SetInt(formatLD,"color2",TuneCar[vehicleid][colorB]);
        DOF2_SaveFile();
        }
	return 0;
}
public OnVehicleRespray(playerid,vehicleid, color1, color2)
{
	TuneCar[vehicleid][colorA] = color1;
	TuneCar[vehicleid][colorB] = color2;
	return 1;
}
public VehicleSpawn(vehicleid)
{
	TuneThisCar(vehicleid);
	LoadModsForAll(vehicleid);
	return 1;
}
tem algo de errado no codigo?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)