[Ajuda] Como salvar tuning?
#1

To tentando a 1 semana salvar tuning de alguma forma,nenhum FS funciona ae fui ver no gamemode e achei uns codigos nгo sei se й para salvar tuning mais alguйm ajuda ae plz:
Codigos:

/tunar:
Quote:

if (strcmp("/tunar", cmdtext, true, 10) == 0)
{
if(PlayerInfo[ playerid ][pProfissao] == Mecanico ||PlayerInfo[playerid][pVip] == 1|| IsPlayerAdmin(playerid) == 1 || pAdmin[playerid] > 1){
ShowPlayerDialog(playerid, tunar, DIALOG_STYLE_LIST, "Tuning Menu", "Rodas\nCores\nPaintjobs\nNitro\nSuspensгo\nAutoTu ning", "OK", "Cancelar");
}
else {
SendClientMessage(playerid, Vermelho, " | ERRO | Vocк nгo tem permissгo.");
}
return 1;
}

if (strcmp("/CorVip", cmdtext, true, 10) == 0)
{
if(PlayerInfo[playerid][pVip2] == 1){
ShowPlayerDialog(playerid, CorVip, DIALOG_STYLE_LIST, "Cores Vip", "Laranja \nVermelho \nRosa \nVerde \nAzul", "OK", "Cancelar");
}
else {
SendClientMessage(playerid, Vermelho, " | ERRO | Vocк nгo tem permissгo.");
}
return 1;
}

if(strcmp(cmd, "/pintar", true) == 0) {
new house[128];
format(house, sizeof(house), "Casas/Casaid%d",house);
if(PlayerInfo[ playerid ][pProfissao] == Mecanico || IsPlayerAdmin(playerid) == 1 || pAdmin[playerid] >= 1 ||guardiao[playerid]){
new cor1,cor2;
new veiculo;
tmp = strtok(cmdtext,idx);
cor1 = strval(tmp);
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "/pintar [cor1] [cor2]");
return 1;
}

cor2 = strval(tmp);
veiculo = GetPlayerVehicleID(playerid);
if(IsPlayerInVehicle(playerid,veiculo)){
ChangeVehicleColor(veiculo,cor1,cor2);
dini_IntSet(house, "CarColor1", cor1);
dini_IntSet(house, "CarColor2", cor2);
format(string, sizeof(string), " | INFO | Mecanico %s(ID: %d) vocк pintou seu carro de %d e %d.", PlayerName(playerid), playerid, cor1, cor2);
SendClientMessage(playerid, VerdeClaro, string);
return 1;
}
}
}

Quote:

new string[128];

for(new carror = 0; carror < MAX_CARROS; carror++)
{
format(string, sizeof(string),"/Carros/carro%d.ini", carror);
if(dini_Exists(string)){
new carroid;
//carroid = CreateVehicle(dini_Int(string,"Modelo"), dini_Float(string,"CordX"), dini_Float(string,"CordY"), dini_Float(string,"CordZ"), dini_Float(string,"Angulo"), dini_Int(string,"Cor1"), dini_Int(string,"Cor2"),false);
SetVehicleNumberPlate(carroid = CreateVehicle(dini_Int(string,"Modelo"), dini_Float(string,"CordX"), dini_Float(string,"CordY"), dini_Float(string,"CordZ"), dini_Float(string,"Angulo"), dini_Int(string,"Cor1"), dini_Int(string,"Cor2"),false)
, dini_Get(string,"Placa"));
//SetVehicleToRespawn(carroid);
dini_IntSet(string,"/Carros/carro%d.ini", carroid);
CarregCar(carroid);
proximocarro++;
}
}

Quote:

if(strcmp(cmdtext,"/salvarveiculo", true) == 0)
{
new pname[24];
GetPlayerName(playerid, pname, sizeof(pname));
format(file, sizeof(file), PASTA_CONTAS, pname);
if (dini_Int(file,"TCarro") == 0) {
SendClientMessage(playerid, Vermelho, " | ERRO | Vocк nгo tem um veiculo da concecionaria.");
return 1;
}
if(IsPlayerInAnyVehicle(playerid)) {
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
new Float:carroX,Float:carroY,Float:carroZ,Float:carro A;
new vid;
vid = GetPlayerVehicleID(playerid);
GetVehiclePos(vid, carroX, carroY, carroZ);
GetVehicleZAngle(vid, carroA);
for(new carro = 0; carro < MAX_CARROS; carro++) {
format(string, sizeof(string), "/Carros/carro%d.ini", carro);
if(strcmp(dini_Get(string, "Dono"), pname, true) == 0) {
if(vid == dini_Int(string,"Id")){
dini_FloatSet(string, "CordX", Float:carroX);
dini_FloatSet(string, "CordY", Float:carroY);
dini_FloatSet(string, "CordZ", Float:carroZ);
dini_FloatSet(string, "Angulo", Float:carroA);
//SendClientMessage(playerid, Verde, "Seu carro foi salvo na sua posiзгo.");
}
}
}
SendClientMessage(playerid, Verde, " | INFO | Seu veiculo foi salvo na sua posiзгo.");
}
else {
SendClientMessage(playerid, Vermelho, " | ERRO | Para salvar a posiзгo vocк presisa estar em um carro.");
}
return 1;
}

Quote:

if(newstate == PLAYER_STATE_DRIVER)
{
new vid;
vid = GetPlayerVehicleID(playerid);
new string[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
new mot, lu, alar, por, cap, porma, ob;
GetVehicleParamsEx(vid, mot, lu, alar, por, cap, porma, ob);
for(new carro = 0; carro < MAX_CARROS; carro++)
{
format(string, sizeof(string),"/Carros/carro%d.ini", carro);
if(dini_Exists(string)){
if(vid == dini_Int(string,"Id")){
if(dini_Int(string,"TDono") == 1 || (dini_Int(string,"TDono2") == 1 && dini_Int(string,"TDono") == 1 && strcmp(dini_Get(string,"Dono2"), pname, true) == 0)){
if(strcmp(dini_Get(string,"Dono"), pname, true) == 0 || strcmp(dini_Get(string,"Dono2"), pname, true) == 0){
if(strcmp(dini_Get(string,"Dono"), pname, true) == 0){
format(gstring, sizeof(gstring)," | INFO | Seja bem vindo '%s' ao seu veiculo '%s'.",dini_Get(string,"Dono"),dini_Get(string,"No me"));
SendClientMessage(playerid, Azul, gstring);
} else if(dini_Int(string,"TDono2") == 1 && dini_Int(string,"TDono") == 1){
format(gstring, sizeof(gstring)," | INFO | Vocк й o segundo dono do veiculo '%s' de '%s', seja bem vindo !", dini_Get(string,"Nome"),dini_Get(string,"Dono"));
SendClientMessage(playerid, Azul, gstring);
}
if(dini_Int(string,"Problema")==1){
format(gstring, sizeof(gstring)," | INFO | Seu veiculo '%s' estб com problemas no motor e precisa de um guincho!", dini_Get(string,"Nome"));
SendClientMessage(playerid, Azul, gstring);
SetVehicleParamsEx(vid, mot, lu, VEHICLE_PARAMS_OFF, por, cap, porma, ob);
SetVehicleParamsEx(vid, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
SetVehicleHealth(vid,400);
} else {
SetVehicleParamsEx(vid, mot, lu, VEHICLE_PARAMS_OFF, por, cap, porma, ob);
SetVehicleParamsEx(vid, VEHICLE_PARAMS_ON, lu, alar, por, cap, porma, ob);
}
} else {
if(dini_Int(string,"Destrancado") == 0){
if(dini_Int(string,"Alarme") == 1){
}
if(dini_Int(string,"Problema")==0){
//format(string, sizeof(string),"Este carro(%s) nгo й seu, й de: \n%s", dini_Get(string,"Nome"),dini_Get(string,"Dono"));
//ShowPlayerDialog(playerid, 75, DIALOG_STYLE_MSGBOX,"New Realisty RPG", string,"Ok","Fechar");
format(gstring, sizeof(gstring)," | INFO | Esse veнculo %s й de '%s', e nгo estб liberado portanto vocк nгo pode dirigн-lo.", dini_Get(string,"Nome"),dini_Get(string,"Dono"));
SendClientMessage(playerid, Azul, gstring);
//RemovePlayerFromVehicle(playerid);
SetVehicleParamsEx(vid, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
} else {
format(string, sizeof(string)," | INFO | Este veiculo '%s' й de '%s', mas o veiculo de '%s' estб com problemas no motor!", dini_Get(string,"Nome"),dini_Get(string,"Dono"));
SendClientMessage(playerid, Azul, string);
GetVehicleParamsEx(vid, mot, lu, alar, por, cap, porma, ob);
SetVehicleParamsEx(vid, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
SetVehicleHealth(vid,400);
}
} else {
GetVehicleParamsEx(vid, mot, lu, alar, por, cap, porma, ob);
if(dini_Int(string,"Alarme") == 1){
SetVehicleParamsEx(vid, mot, lu, VEHICLE_PARAMS_ON, por, cap, porma, ob);
}
if(dini_Int(string,"Problema")==1){
format(gstring, sizeof(gstring)," | INFO | Esse veнculo %s й de '%s', e ele deixou liberado e vocк pode dirigн-lo.", dini_Get(string,"Nome"),dini_Get(string,"Dono"),di ni_Get(string,"Dono"));
SendClientMessage(playerid, Azul, gstring);
format(gstring, sizeof(gstring)," | INFO | Mas o veiculo de %s estб com problemas no motor!", dini_Get(string,"Dono"));
SendClientMessage(playerid, Azul, gstring);
SetVehicleParamsEx(vid, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
SetVehicleHealth(vid,400);
} else {
format(gstring, sizeof(gstring)," | INFO | Esse veнculo %s й de '%s', e ele deixou liberado e vocк pode dirigн-lo.", dini_Get(string,"Nome"),dini_Get(string,"Dono"),di ni_Get(string,"Dono"));
SendClientMessage(playerid, Azul, gstring);
}
}
}
} else {
SetVehicleParamsEx(vid, VEHICLE_PARAMS_OFF, lu, alar, por, cap, porma, ob);
format(string, sizeof(string)," | Concessionбria | Este veiculo estб a venda ! Preзo: %d $, use /comprarveiculo", dini_Int(string,"Preco"));
SendClientMessage(playerid, Amarelo, string);
}
}
}
}

OnVehicleSpawn
Quote:

public OnVehicleSpawn(vehicleid){
SetTimerEx("CarregCar", 500, false, "d", vehicleid);
new string[128];
for(new carro = 0; carro < MAX_CARROS; carro++)
{
format(string, sizeof(string), "/Carros/carro%d.ini", carro);
if(dini_Int(string, "Id") == vehicleid){
new mot, lu, alar, por, cap, porma, ob;
GetVehicleParamsEx(vehicleid, mot, lu, alar, por, cap, porma, ob);
//SetVehicleHealth(vehicleid, dini_Float(string,"Mundo"));
if(dini_Int(string,"Farol") == 0){
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
}
if(dini_Int(string,"Farol") == 1){
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TPaint") == 1){
ChangeVehiclePaintjob(vehicleid, dini_Int(string,"Paint"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TFront") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Front"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TRear") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Rear"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TRoof") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Roof"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TSpoiler") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Spoiler"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TSide") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Side"));
AddVehicleComponent(vehicleid, dini_Int(string, "Side2"));
}
if(dini_Int(string, "TBull") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Bull"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TWheels") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Wheels"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TStereo") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Stereo"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "THy") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Hy"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TNitro") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Nitro"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
}
}
}

public CarregCar(vehicleid){
new string[128];
for(new carro = 0; carro < MAX_CARROS; carro++)
{
format(string, sizeof(string), "/Carros/carro%d.ini", carro);
if(dini_Int(string, "Id") == vehicleid){
new mot, lu, alar, por, cap, porma, ob;
GetVehicleParamsEx(vehicleid, mot, lu, alar, por, cap, porma, ob);
if(dini_Int(string,"Farol") == 0){
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_OFF, alar, por, cap, porma, ob);
}
if(dini_Int(string,"Farol") == 1){
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string,"Capo") == 0){
SetVehicleParamsEx(vehicleid, mot, lu, alar, por, VEHICLE_PARAMS_OFF, porma, ob);
}
if(dini_Int(string,"Capo") == 1){
SetVehicleParamsEx(vehicleid, mot, lu, alar, por, VEHICLE_PARAMS_ON, porma, ob);
}
if(dini_Int(string,"Alarme") == 0){
SetVehicleParamsEx(vehicleid, mot, lu, VEHICLE_PARAMS_OFF, por, cap, porma, ob);
}
if(dini_Int(string,"Alarme") == 1){
//SetVehicleParamsEx(vehicleid, mot, lu, VEHICLE_PARAMS_ON, por, cap, porma, ob);
}
if(dini_Int(string,"Portas") == 0){
SetVehicleParamsEx(vehicleid, mot, lu, alar, VEHICLE_PARAMS_OFF, cap, porma, ob);
}
if(dini_Int(string,"Portas") == 1){
SetVehicleParamsEx(vehicleid, mot, lu, alar, por, VEHICLE_PARAMS_ON, porma, ob);
}
if(dini_Int(string,"PMalas") == 0){
SetVehicleParamsEx(vehicleid, mot, lu, alar, por, cap, VEHICLE_PARAMS_OFF, ob);
}
if(dini_Int(string,"PMalas") == 1){
SetVehicleParamsEx(vehicleid, mot, lu, alar, por, cap, VEHICLE_PARAMS_ON, ob);
}
if(dini_Int(string, "TPaint") == 1){
ChangeVehiclePaintjob(vehicleid, dini_Int(string,"Paint"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TFront") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Front"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TRear") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Rear"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TRoof") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Roof"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TSpoiler") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Spoiler"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TSide") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Side"));
AddVehicleComponent(vehicleid, dini_Int(string, "Side2"));
}
if(dini_Int(string, "TBull") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Bull"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TWheels") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Wheels"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TStereo") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Stereo"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "THy") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Hy"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
if(dini_Int(string, "TNitro") == 1){
AddVehicleComponent(vehicleid, dini_Int(string, "Nitro"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
ChangeVehicleColor(vehicleid, dini_Int(string,"Cor1"), dini_Int(string,"Cor2"));
SetVehicleParamsEx(vehicleid, mot, VEHICLE_PARAMS_ON, alar, por, cap, porma, ob);
}
}
}

public ModCar(playerid) { // changed to switch method to reduce processor load on server
// new modelid = GetVehicleModel(GetPlayerVehicleID(playerid)); // this executes a fair amt of stuff, so running it once to populate variable (modelid),THEN checking variable, makes more sense
new string[128];
format(string, sizeof(string), "/Carros/carro%d.ini", GetPlayerCarID(playerid));
switch(dini_Int(string,"Modelo")) {
case 562,565,559,561,560,575,534,567,536,535,576,411,57 9,602,496,518,527,589,597,419,
533,526,474,545,517,410,600,436,580,439,549,491,44 5,604,507,585,587,466,492,546,551,516,
426, 547, 405, 409, 550, 566, 540, 421, 529,431,438,437,420,525,552,416,433,427,490,528,
407,544,470,598,596,599,601,428,499,609,524,578,48 6,406,573,455,588,403,514,423,
414,443,515,456,422,482,530,418,572,413,440,543,58 3,478,554,402,542,603,475,568,504,457,
483,508,429,541,415,480,434,506,451,555,477,400,40 4,489,479,442,458,467,558: {
TogglePlayerControllable(playerid,0);
return SendClientMessage(playerid, VerdeClaro, " | INFO | Use SPACE para selecionar.");
}
default: return SendClientMessage(playerid,Vermelho," | AVISO | Este veiculo nгo pode ser tunado.");
}
return 1;
}

stock FormatCar(playerid){
new string[128];
format(string, sizeof(string), "/Carros/carro%d.ini", GetPlayerCarID(playerid));
return string;
}

stock GetPlayerCarID(playerid)
{
new string[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
//for(new carro = 0; carro < MAX_CARROS; carro++)
//{
format(string, sizeof(string), "/Carros/carro%d.ini", dini_Int(filene(pname),"CarroID"));
if(strcmp(dini_Get(string, "Dono"), pname, true) == 0) {
return dini_Int(filene(pname),"CarroID");
//SendClientMessage(playerid, Verde, "Seu carro foi salvo na sua posiзгo.");
// }
}
return -1;
}

Galera sou muito ruim de pawno,nгo sei nem se mandei o que й certo =\
Por favor alguйm ajuda salvar tuning =']
Reply


Messages In This Thread
Como salvar tuning? - by logan1910 - 16.06.2014, 06:55
Re: [AJUDA]Como salvar tuning? - by MultiKill - 16.06.2014, 15:13
Re: [AJUDA]Como salvar tuning? - by logan1910 - 16.06.2014, 20:18
Re: [AJUDA]Como salvar tuning? - by lucas9946 - 16.06.2014, 20:26
Re: [AJUDA]Como salvar tuning? - by MultiKill - 16.06.2014, 20:29
Re: [AJUDA]Como salvar tuning? - by logan1910 - 17.06.2014, 00:51
Re: [AJUDA]Como salvar tuning? - by MultiKill - 17.06.2014, 01:24
Re: [AJUDA]Como salvar tuning? - by logan1910 - 17.06.2014, 02:06
Re: [AJUDA]Como salvar tuning? - by MultiKill - 17.06.2014, 02:23
Re: [AJUDA]Como salvar tuning? - by logan1910 - 17.06.2014, 03:17
Re: [AJUDA]Como salvar tuning? - by MultiKill - 17.06.2014, 03:28

Forum Jump:


Users browsing this thread: 2 Guest(s)