[Pomoc] nece da sprema letjelice nekima sprema nekima ne

Započeo [GU:RP] ivica 156, Februar 15, 2012, 23:28:40 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 3 gostiju pregledaju ovu temu.

Kod: [Odaberi]
Skripta koju koristim:Cyber
Detaljan opis problema:imam za letjelice i sada nekima spremi a nekima ne a ak nekima sprema uniste se poslije gmx/reseta evo toga
Kod:
forward LetjeliceSave(playerid);
public LetjeliceSave(playerid)
{
   if(IsPlayerConnected(playerid))
   {
      new dateiname[MAX_PLAYER_NAME+48];
      new playername[MAX_PLAYER_NAME];
      new var[128];
       format(dateiname, sizeof(dateiname), "Letjelice/%s.let", playername);
      new File: PlaneFile = fopen(dateiname, io_write);
       format(var, 256, "PLANE_planeTyp=%i\n", Planelist[playerid][planeTyp]); fwrite(PlaneFile, var);
       format(var, 256, "PLANE_X=%f\n", Planelist[playerid][X3]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_Y=%f\n", Planelist[playerid][Y3]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_Z=%f\n", Planelist[playerid][Z3]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_Rot=%f\n", Planelist[playerid][Rotation]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_Status=%i\n", Planelist[playerid][Status]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_Lock=%i\n", Planelist[playerid][Lock]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_Paintjob=%i\n", Planelist[playerid][Paintjob]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_Color1=%i\n", Planelist[playerid][Color1]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_Color2=%i\n", Planelist[playerid][Color2]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod1=%i\n", Planelist[playerid][mod1]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod2=%i\n", Planelist[playerid][mod2]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod3=%i\n", Planelist[playerid][mod3]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod4=%i\n", Planelist[playerid][mod4]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod5=%i\n", Planelist[playerid][mod5]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod6=%i\n", Planelist[playerid][mod6]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod7=%i\n", Planelist[playerid][mod7]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod8=%i\n", Planelist[playerid][mod8]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod9=%i\n", Planelist[playerid][mod9]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod10=%i\n", Planelist[playerid][mod10]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod11=%i\n", Planelist[playerid][mod11]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod12=%i\n", Planelist[playerid][mod12]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod13=%i\n", Planelist[playerid][mod13]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod14=%i\n", Planelist[playerid][mod14]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod15=%i\n", Planelist[playerid][mod15]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod16=%i\n", Planelist[playerid][mod16]); fwrite(PlaneFile, var);
      format(var, 256, "PLANE_mod17=%i\n", Planelist[playerid][mod17]); fwrite(PlaneFile, var);
       fclose(PlaneFile);
   }
   return 1;
}------za spremanje

Kod:
stock UcitajLetjelicu(playerid)
{
   new dateiname[256+4];
   new playername[MAX_PLAYER_NAME+100];
   // Letjelice
   Planelist[playerid][planeTyp]=-1; Planelist[playerid][X3]=0.0; Planelist[playerid][Y3]=0.0; Planelist[playerid][Z3]=0.0;
   Planelist[playerid][Rotation]=0.0; Planelist[playerid][Status]=0; Planelist[playerid][Lock]=0; Planelist[playerid][Carid]=-1;
   Planelist[playerid][Color1]=-1; Planelist[playerid][Color2]=-1; Planelist[playerid][mod1]=-1; Planelist[playerid][mod2]=-1;
   Planelist[playerid][mod3]=-1; Planelist[playerid][mod4]=-1; Planelist[playerid][mod5]=-1; Planelist[playerid][mod6]=-1;
   Planelist[playerid][mod7]=-1; Planelist[playerid][mod8]=-1; Planelist[playerid][mod9]=-1; Planelist[playerid][mod10]=-1;
   Planelist[playerid][mod11]=-1; Planelist[playerid][mod12]=-1; Planelist[playerid][mod13]=-1; Planelist[playerid][mod14]=-1;
   Planelist[playerid][mod15]=-1; Planelist[playerid][mod16]=-1; Planelist[playerid][mod17]=-1; Planelist[playerid][Paintjob]=-1;
   planeSpectating[playerid][0]=-1;
   offerPlane[playerid]={-1,0};

   GetPlayerName(playerid, playername, sizeof(playername));
   format(dateiname, sizeof(dateiname), "Letjelice/%s.let", playername);
   if (fexist(dateiname))
   {
      new File: PlaneFile = fopen(dateiname, io_read);
      if ( PlaneFile )
      {
          new key[ 256 ];
          new Data[ 256 ];
          while ( fread( PlaneFile , Data , sizeof( Data ) ) )
         {
            key = ini_GetKey(Data);
            if(strcmp(key,"PLANE_planeTyp",true)==0) { Planelist[playerid][planeTyp]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_X",true)==0) { Planelist[playerid][X3]=floatstr(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_Y",true)==0) { Planelist[playerid][Y3]=floatstr(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_Z",true)==0) { Planelist[playerid][Z3]=floatstr(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_Rot",true)==0) { Planelist[playerid][Rotation]=floatstr(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_Status",true)==0) { Planelist[playerid][Status]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_Lock",true)==0) { Planelist[playerid][Lock]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_Paintjob",true)==0) { Planelist[playerid][Paintjob]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_Color1",true)==0) { Planelist[playerid][Color1]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_Color2",true)==0) { Planelist[playerid][Color2]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod1",true)==0) { Planelist[playerid][mod1]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod2",true)==0) { Planelist[playerid][mod2]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod3",true)==0) { Planelist[playerid][mod3]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod4",true)==0) { Planelist[playerid][mod4]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod5",true)==0) { Planelist[playerid][mod5]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod6",true)==0) { Planelist[playerid][mod6]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod7",true)==0) { Planelist[playerid][mod7]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod8",true)==0) { Planelist[playerid][mod8]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod9",true)==0) { Planelist[playerid][mod9]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod10",true)==0) { Planelist[playerid][mod10]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod11",true)==0) { Planelist[playerid][mod11]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod12",true)==0) { Planelist[playerid][mod12]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod13",true)==0) { Planelist[playerid][mod13]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod14",true)==0) { Planelist[playerid][mod14]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod15",true)==0) { Planelist[playerid][mod15]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod16",true)==0) { Planelist[playerid][mod16]=strval(ini_GetValue(Data)); }
             else if(strcmp(key,"PLANE_mod17",true)==0) { Planelist[playerid][mod17]=strval(ini_GetValue(Data)); }
         }
      }
       fclose(PlaneFile);
       if(Planelist[playerid][planeTyp]!=-1 && Planelist[playerid][Status]==1)
       {
           Planelist[playerid][Carid]=CreateTunedPlane(playerid);
      }
   }
}za ucitavanje
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):