[Pomoc]Ne sacuva /mo

Započeo Muhamed., Februar 21, 2012, 16:29:22 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.


Skripta koju koristim:CLRP Edit
Detaljan opis problema:Kada kupim Motor i odem relog,vratim se i nema motora ! Sa autima je sve u redu i sve sam pregledao i ne mogu naci uzrok problema !Primijetio sam da mi sacuva Motor u Motori Folderu ali sa .moto,ne kao prije .motor!
Dio skripte:public MotoSave(playerid)
{
if(IsPlayerConnected(playerid))
{
new dateiname[MAX_PLAYER_NAME+48];
new playername[MAX_PLAYER_NAME];
new var[128];
    format(dateiname, sizeof(dateiname), "Motori/%s.motor", playername);
new File: BikeFile = fopen(dateiname, io_write);
    format(var, 256, "BH_bTyp=%i\n", Bikelist[playerid][bTyp]); fwrite(BikeFile, var);
    format(var, 256, "BH_X=%f\n", Bikelist[playerid][mX]); fwrite(BikeFile, var);
format(var, 256, "BH_Y=%f\n", Bikelist[playerid][mY]); fwrite(BikeFile, var);
format(var, 256, "BH_Z=%f\n", Bikelist[playerid][mZ]); fwrite(BikeFile, var);
format(var, 256, "BH_Rot=%f\n", Bikelist[playerid][mRotation]); fwrite(BikeFile, var);
format(var, 256, "BH_Status=%i\n", Bikelist[playerid][Status]); fwrite(BikeFile, var);
format(var, 256, "BH_Lock=%i\n", Bikelist[playerid][Lock]); fwrite(BikeFile, var);
format(var, 256, "BH_Paintjob=%i\n", Bikelist[playerid][Paintjob]); fwrite(BikeFile, var);
format(var, 256, "BH_Color1=%i\n", Bikelist[playerid][Color1]); fwrite(BikeFile, var);
format(var, 256, "BH_Color2=%i\n", Bikelist[playerid][Color2]); fwrite(BikeFile, var);
format(var, 256, "BH_mod1=%i\n", Bikelist[playerid][mod1]); fwrite(BikeFile, var);
format(var, 256, "BH_mod2=%i\n", Bikelist[playerid][mod2]); fwrite(BikeFile, var);
format(var, 256, "BH_mod3=%i\n", Bikelist[playerid][mod3]); fwrite(BikeFile, var);
format(var, 256, "BH_mod4=%i\n", Bikelist[playerid][mod4]); fwrite(BikeFile, var);
format(var, 256, "BH_mod5=%i\n", Bikelist[playerid][mod5]); fwrite(BikeFile, var);
format(var, 256, "BH_mod6=%i\n", Bikelist[playerid][mod6]); fwrite(BikeFile, var);
format(var, 256, "BH_mod7=%i\n", Bikelist[playerid][mod7]); fwrite(BikeFile, var);
format(var, 256, "BH_mod8=%i\n", Bikelist[playerid][mod8]); fwrite(BikeFile, var);
format(var, 256, "BH_mod9=%i\n", Bikelist[playerid][mod9]); fwrite(BikeFile, var);
format(var, 256, "BH_mod10=%i\n", Bikelist[playerid][mod10]); fwrite(BikeFile, var);
format(var, 256, "BH_mod11=%i\n", Bikelist[playerid][mod11]); fwrite(BikeFile, var);
format(var, 256, "BH_mod12=%i\n", Bikelist[playerid][mod12]); fwrite(BikeFile, var);
format(var, 256, "BH_mod13=%i\n", Bikelist[playerid][mod13]); fwrite(BikeFile, var);
format(var, 256, "BH_mod14=%i\n", Bikelist[playerid][mod14]); fwrite(BikeFile, var);
format(var, 256, "BH_mod15=%i\n", Bikelist[playerid][mod15]); fwrite(BikeFile, var);
format(var, 256, "BH_mod16=%i\n", Bikelist[playerid][mod16]); fwrite(BikeFile, var);
format(var, 256, "BH_mod17=%i\n", Bikelist[playerid][mod17]); fwrite(BikeFile, var);
    fclose(BikeFile);
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno):

Daj komandu kojom kupis motor, posto se u njoj stvara fajl...


a u ovom public-u koj koristis, probaj da ovo:

new dateiname[MAX_PLAYER_NAME+48];

promeni u npr:

new dateiname[MAX_PLAYER_NAME+68];

neverujem da ce tako proraditi, al daj komandu kojom kupujes vozilo

if(strcmp(cmd, "/kupimotor", true) == 0)
{
    if (bSpectating[playerid][0]!=-1)
    {
        if (Bikelist[playerid][bTyp]==-1)
        {
            new price = BikeBuylist[bSpectating[playerid][0]][Price];
            if (price <= GetPlayerMoney(playerid))
            {
                new autohaus=BikeBuylist[bSpectating[playerid][0]][Autohaus];
            GivePlayerMoney(playerid, - price);
            Bikelist[playerid][bTyp]=bSpectating[playerid][0]; Bikelist[playerid][mX]=Bikespawns[autohaus][mX]; Bikelist[playerid][mY]=Bikespawns[autohaus][mY];
Bikelist[playerid][mZ]=Bikespawns[autohaus][mZ]; Bikelist[playerid][mRotation]=Bikespawns[autohaus][mRotation]; Bikelist[playerid][Status]=1; Bikelist[playerid][Lock]=0;
Bikelist[playerid][Carid]=CreateVehicle(BikeBuylist[bSpectating[playerid][0]][Modelid],Bikelist[playerid][mX],Bikelist[playerid][mY],Bikelist[playerid][mZ],Bikelist[playerid][mRotation],-1,-1,-1);
        SetBikeParamsForAll(BikeBuylist[bSpectating[playerid][0]][Carid],0,0);
        TogglePlayerControllable(playerid,1);
        bSpectating[playerid][0]=-1;
        RemovePlayerFromVehicle(playerid);
        MotoSave(playerid);
format(string,128,"* Cestitamo, kupili ste motor marke {FFFFFF}%s "COL_YELLOW"za {FFFFFF}$%i!",BikeBuylist[Bikelist[playerid][bTyp]][bName],price);
SendClientMessage(playerid, YELLOW, string);
SendClientMessage(playerid, ZELENKASTA, "Ako ti je motor unisten {FFFFFF}/mo fix "COL_SVPLAVA"za popravak.");
SendClientMessage(playerid, ZELENKASTA, "Motor mozees zakljucat i otkljucat sa komandom {FFFFFF}/mo lock.");
SendClientMessage(playerid, ZELENKASTA, "Ostalo: {FFFFFF}(/mo)to.");
SendClientMessage(playerid, COLOR_YELLOW, "Motor sada pripada vama! Zabavite se!");
}
                else { format(string, 128, "Nemas dovoljno novaca! (Potrebno: $%i)!", price); SendClientMessage(playerid, COLOR_LIGHTRED, string); }
}
else { SendClientMessage(playerid, COLOR_GREY, "Vec posjedujes motor!"); }
    }
    else { SendClientMessage(playerid, COLOR_GREY, "Nisi u izlozbenom motoru!"); }
    return 1;
}



nema onog sto sam trazio... sve u svmeu probaj ono sto sam ti rekao u proslom postu, jer ispada da je string premali...

znaci ovo:

new dateiname[MAX_PLAYER_NAME+48];
i
new var[128];
promenis u:

new dateiname[MAX_PLAYER_NAME+68];
new var[328];

Nije mi pomoglo ! :S
u svakom slucaju hvala !
Poslednja Izmena: Februar 21, 2012, 17:00:25 POSLE PODNE od [Pawno | MTA] Muhamed