Hallo liebe Community,
ich habe folgendes Problem und zwar hab ich ein caredit System Geschrieben womit ich Farbe,Besitzer und (Löschen) ändern kann.
Das Problem er Speichert bzw läd die neue Farbe nicht ich finde aber auch nicht den Fehler.
Hier mal die Codes:
ocmd:caredit(playerid,params[])
{
if(sInfo[playerid][Adminlevel]>=ADMIN_HIGH_ADMIN)
{
if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,rot,"Du bist in keinem Fahrzeug!");
if(GetPVarInt(playerid,"CarEdit")==0)
{
SetPVarInt(playerid,"CarEdit",1);
PlayerTextDrawShow(playerid,carlabel_background[playerid]);
PlayerTextDrawShow(playerid,carlabel_heading[playerid]);
PlayerTextDrawShow(playerid,carlabel_owner[playerid]);
PlayerTextDrawShow(playerid,carlabel_color[playerid]);
PlayerTextDrawShow(playerid,carlabel_delete[playerid]);
SelectTextDraw(playerid,blau);
return 1;
}
else
if(GetPVarInt(playerid,"CarEdit")==1)
{
SetPVarInt(playerid,"CarEdit",0);
new vID = GetPlayerVehicleID(playerid);
for(new i=0; i<sizeof(vInfo); i++)
{
if(vInfo[i][v_id_x]!=vID)continue;
new vdbid = vInfo[i][v_db_id];
new string[64];
format(string,sizeof string,"/autos/car %i.txt",vInfo[i][v_db_id]);
DestroyVehicle(vInfo[i][v_id_x]);
vInfo[i][v_id_x]=0;
SaveCar(vID);
LoadCar(vdbid);
PlayerTextDrawHide(playerid,carlabel_background[playerid]);
PlayerTextDrawHide(playerid,carlabel_heading[playerid]);
PlayerTextDrawHide(playerid,carlabel_owner[playerid]);
PlayerTextDrawHide(playerid,carlabel_color[playerid]);
PlayerTextDrawHide(playerid,carlabel_delete[playerid]);
return 1;
}
return 1;
}
}else{
SendClientMessage(playerid,rot,"Du darfst diesen Befhel nicht nutzen!");
}
return 1;
}
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
if(playertextid == carlabel_color[playerid])
{
ShowPlayerDialog(playerid,DIALOG_EDIT_CAR_COLOR,DIALOG_STYLE_INPUT,"Fabre aendern","Bitte gib Farbe 1 an\nVon 0-255","Abbrechen","Weiter");
PlayerTextDrawHide(playerid,carlabel_background[playerid]);
PlayerTextDrawHide(playerid,carlabel_heading[playerid]);
PlayerTextDrawHide(playerid,carlabel_owner[playerid]);
PlayerTextDrawHide(playerid,carlabel_color[playerid]);
PlayerTextDrawHide(playerid,carlabel_delete[playerid]);
CancelSelectTextDraw(playerid);
}
return 1;
}
SaveCar(vID)
{
for(new i=0; i<sizeof(vInfo); i++)
{
if(vInfo[i][v_id_x]!=vID)continue;
new string[64];
format(string,sizeof string,"/autos/car %i.txt",vInfo[i][v_db_id]);
new color1,color2;
GetVehicleColor(vInfo[i][v_id_x], color1,color2);
vInfo[i][v_color_1]=color1;
vInfo[i][v_color_2]=color2;
vInfo[i][v_spoiler]=GetVehicleComponentInSlot(vInfo[i][v_id_x],0);
vInfo[i][v_hood]=GetVehicleComponentInSlot(vInfo[i][v_id_x],1);
vInfo[i][v_roof]=GetVehicleComponentInSlot(vInfo[i][v_id_x],2);
vInfo[i][v_sideskirt]=GetVehicleComponentInSlot(vInfo[i][v_id_x],3);
vInfo[i][v_lamps]=GetVehicleComponentInSlot(vInfo[i][v_id_x],4);
vInfo[i][v_nitro]=GetVehicleComponentInSlot(vInfo[i][v_id_x],5);
vInfo[i][v_exhaust]=GetVehicleComponentInSlot(vInfo[i][v_id_x],6);
vInfo[i][v_wheels]=GetVehicleComponentInSlot(vInfo[i][v_id_x],7);
vInfo[i][v_stereo]=GetVehicleComponentInSlot(vInfo[i][v_id_x],8);
vInfo[i][v_hydraulics]=GetVehicleComponentInSlot(vInfo[i][v_id_x],9);
vInfo[i][v_front_bumper]=GetVehicleComponentInSlot(vInfo[i][v_id_x],10);
vInfo[i][v_rear_bumper]=GetVehicleComponentInSlot(vInfo[i][v_id_x],11);
vInfo[i][v_vent_left]=GetVehicleComponentInSlot(vInfo[i][v_id_x],12);
vInfo[i][v_vent_right]=GetVehicleComponentInSlot(vInfo[i][v_id_x],13);
ChangeVehiclePaintjob(vInfo[i][v_id_x],vInfo[i][v_paintjob]);
dini_IntSet(string,"Color_1",vInfo[i][v_color_1]);
dini_IntSet(string,"Color_2",vInfo[i][v_color_2]);
dini_IntSet(string,"v_spoiler",vInfo[i][v_spoiler]);
dini_IntSet(string,"v_hood",vInfo[i][v_hood]);
dini_IntSet(string,"v_roof",vInfo[i][v_roof]);
dini_IntSet(string,"v_sideskirt",vInfo[i][v_sideskirt]);
dini_IntSet(string,"v_lamps",vInfo[i][v_lamps]);
dini_IntSet(string,"v_nitro",vInfo[i][v_nitro]);
dini_IntSet(string,"v_exhaust",vInfo[i][v_exhaust]);
dini_IntSet(string,"v_wheels",vInfo[i][v_wheels]);
dini_IntSet(string,"v_stereo",vInfo[i][v_stereo]);
dini_IntSet(string,"v_hydraulics",vInfo[i][v_hydraulics]);
dini_IntSet(string,"v_front_bumper",vInfo[i][v_front_bumper]);
dini_IntSet(string,"v_rear_bumper",vInfo[i][v_rear_bumper]);
dini_IntSet(string,"v_vent_left",vInfo[i][v_vent_left]);
dini_IntSet(string,"v_vent_right",vInfo[i][v_vent_right]);
dini_IntSet(string,"v_paintjob",vInfo[i][v_paintjob]);
dini_FloatSet(string,"Tank",vInfo[i][v_tank]);
}
return 1;
}
LoadCar(vdbid)
{
for( new i=1; i<sizeof vInfo; i++)
{
if(vInfo[i][v_id_x]!=0)continue;
new string[164];
format(string,sizeof string,"/autos/car %i.txt",vdbid);
if(!dini_Exists(string))continue;
new vID = getFreeCarID();
SetVehicleParamsEx(i,0,0,0,0,0,0,0);
vInfo[vID][v_db_id]= i;
vInfo[vID][v_vehicleid]= dini_Int(string,"VehicleID");
vInfo[vID][v_x]= dini_Float(string,"x");
vInfo[vID][v_y]= dini_Float(string,"y");
vInfo[vID][v_z]= dini_Float(string,"z");
vInfo[vID][v_r]= dini_Float(string,"r");
vInfo[vID][v_paintjob]=dini_Int(string,"v_paintjob");
vInfo[vID][v_color_1]= dini_Int(string,"Color_1");
vInfo[vID][v_color_2]= dini_Int(string,"Color_2");
vInfo[vID][v_fraktion]= dini_Int(string,"Fraktion");
vInfo[vID][v_tank]= dini_Float(string,"Tank");
vInfo[vID][v_id_x]=CreateVehicle(vInfo[vID][v_vehicleid],vInfo[vID][v_x],vInfo[vID][v_y],vInfo[vID][v_z],vInfo[vID][v_r],vInfo[vID][v_color_1],vInfo[vID][v_color_2],0);
ChangeVehiclePaintjob(vInfo[vID][v_id_x],vInfo[vID][v_paintjob]);
vInfo[vID][v_status]=1;
SetVehicleParamsEx(vInfo[vID][v_id_x],0,0,0,0,0,0,0);
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_spoiler"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_hood"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_roof"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_sideskirt"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_lamps"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_nitro"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_exhaust"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_wheels"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_stereo"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_hydraulics"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_front_bumper"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_rear_bumper"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_vent_left"));
AddVehicleComponent(vInfo[vID][v_id_x],dini_Int(string,"v_vent_right"));
printf("Auto// Verzeichnes: ../scriptfiles%s ID: %i geladen!",string,vID);
return 1;
}
return 1;
}
if(dialogid==DIALOG_EDIT_CAR_COLOR_2)
{
if(response==1)
{
new vID = GetPlayerVehicleID(playerid);
new Color2 = strlen(inputtext);
for(new i=0; i<sizeof vInfo; i++)
{
if(vInfo[i][v_id_x]!=vID)continue;
vInfo[i][v_color_2]=Color2;
break;
}
SendClientMessage(playerid,grün,"Du hast die Lackierung des Wagens Geändert!");
PlayerTextDrawShow(playerid,carlabel_background[playerid]);
PlayerTextDrawShow(playerid,carlabel_heading[playerid]);
PlayerTextDrawShow(playerid,carlabel_owner[playerid]);
PlayerTextDrawShow(playerid,carlabel_color[playerid]);
PlayerTextDrawShow(playerid,carlabel_delete[playerid]);
}
else
{
SendClientMessage(playerid,rot,"Du hast den Vorgang Abgebrochen!");
}
}
if(dialogid==DIALOG_EDIT_CAR_COLOR)
{
if(response==1)
{
new vID = GetPlayerVehicleID(playerid);
new Color1 = strlen(inputtext);
for(new i=0; i<sizeof vInfo; i++)
{
if(vInfo[i][v_id_x]!=vID)continue;
vInfo[i][v_color_1]=Color1;
break;
}
ShowPlayerDialog(playerid,DIALOG_EDIT_CAR_COLOR_2,DIALOG_STYLE_INPUT,"Farbe aendern","Bitte gib Farbe 2 an\nVon 0-255","Abbrechen","Weiter");
}
else
{
SendClientMessage(playerid,rot,"Du hast den Vorgang Abgebrochen!");
}
}
Vielen Dank schonmal an die Helfer