Szerző Téma: Autószalon hiba  (Megtekintve 584 alkalommal)

Autószalon hiba
« Dátum: 2013. január 27. - 16:52:59 »
0 Show voters
Sziasztok tudnátok nekem segíteni, hogy miért nem jó az autószalon? Megveszem a kocsit és akkor lecsatlakozik a szeró, és a kocsit sem adja be felcsatlakozásnál (LTRPG)
Lehet ezzel lessz itt a baj.:
 
public LoadVehiclesPos() //betöltés
{
    new arrCoords[12][32];
    new strFromFile2[256];
    new Float:vx,Float:vy,Float:vz,Float:vangle,Float:health,color1,color2,vehicleid,jarmuid;
    for(new v=1; v<szalon+1; v++)
{
    printf(\"%d ID autó beolvasása...\\r\\n\",v);
    format(stringx, sizeof(stringx), \"autok/%d.txt\", v);
    new File: vkfile2 = fopen(stringx, io_readwrite);
    fread(vkfile2, strFromFile2);
    printf(\"%d ID autó beolvasása sikeres\\r\\n\",v);
    split(strFromFile2, arrCoords, \',\');
    jarmuid = strval(arrCoords[0]);
    vx = floatstr(arrCoords[1]);
    vy = floatstr(arrCoords[2]);
    vz = floatstr(arrCoords[3]);
    vangle = floatstr(arrCoords[4]);
    health = floatstr(arrCoords[5]);
    color1 = strval(arrCoords[6]);
    color2 = strval(arrCoords[7]);
    kocsikulcsk[jarmuid] = strval(arrCoords[8]);
    vehicleid = strval(arrCoords[9]);
    szalonkeladva[v] = strval(arrCoords[10]);
    strmid(rendszam[jarmuid], arrCoords[11], 0, strlen(arrCoords[11]), 255);
    kocsiszink[jarmuid] = color1;
    kocsiszin2k[jarmuid] = color2;
    new a = AddStaticVehicleEx(vehicleid, vx,vy,vz,vangle,color1,color2,600);
    SetVehicleHealth(a, health);
    //SetVehicleNumberPlate(a, rendszam[jarmuid]);
fclose(vkfile2);
}
    return 1;
}
LoadVehicleBought(jarmuid) //betöltés-eladva-e
{
    new arrCoords[12][32];
    new strFromFile2[256];
    printf(\"LoadVehicleBought(%d)\\r\\n\", jarmuid);
    printf(\"%d ID autó beolvasása...\\r\\n\",jarmuid);
    format(stringx, sizeof(stringx), \"autok/%d.txt\", jarmuid);
    new File: vkfile2 = fopen(stringx, io_read);
    fread(vkfile2, strFromFile2);
    printf(\"%d ID autó beolvasása sikeres\\r\\n\",jarmuid);
    split(strFromFile2, arrCoords, \',\');
    szalonkeladva[jarmuid] = strval(arrCoords[10]);
fclose(vkfile2);
    return 1;
}
LoadVehiclePos(v) //betöltés
{
    new arrCoords[12][32];
    new strFromFile2[256];
    printf(\"LoadVehiclePos(%d)\\r\\n\", v);
    new Float:vx,Float:vy,Float:vz,Float:vangle,Float:health,color1,color2,vehicleid,jarmuid;
    printf(\"%d ID autó beolvasása...\\r\\n\",v);
    format(stringx, sizeof(stringx), \"autok/%d.txt\", v);
    new File: vkfile2 = fopen(stringx, io_read);
    fread(vkfile2, strFromFile2);
    printf(\"%d ID autó beolvasása sikeres\\r\\n\",v);
    split(strFromFile2, arrCoords, \',\');
    jarmuid = strval(arrCoords[0]);
    vx = floatstr(arrCoords[1]);
    vy = floatstr(arrCoords[2]);
    vz = floatstr(arrCoords[3]);
    vangle = floatstr(arrCoords[4]);
    health = floatstr(arrCoords[5]);
    color1 = strval(arrCoords[6]);
    color2 = strval(arrCoords[7]);
    kocsikulcsk[jarmuid] = strval(arrCoords[8]);
    vehicleid = strval(arrCoords[9]);
    szalonkeladva[v] = strval(arrCoords[10]);
    strmid(rendszam[jarmuid], arrCoords[11], 0, strlen(arrCoords[11]), 255);
    kocsiszink[jarmuid] = color1;
    kocsiszin2k[jarmuid] = color2;
    new a = AddStaticVehicleEx(vehicleid, vx,vy,vz,vangle,color1,color2,600);
    SetVehicleHealth(a, health);
    //SetVehicleNumberPlate(a, rendszam[jarmuid]);
fclose(vkfile2);
    return 1;
}
public SaveVehiclePos(vehicleid, jarmuid, color1, color2, eladva) //elmentés
{
new vkstringx[256];
printf(\"SaveVehiclePos(%d,%d,%d,%d,%d)\\r\\n\", vehicleid,jarmuid,color1,color2,eladva);
new Float:vx,Float:vy,Float:vz,Float:vangle,Float:health;
new File: vkfile;
GetVehiclePos(jarmuid, vx,vy,vz);
GetVehicleZAngle(jarmuid, vangle);
GetVehicleHealth(jarmuid, health);
format(vkstringx, sizeof(vkstringx), \"%d,%f,%f,%f,%f,%f,%d,%d,%d,%d,%d,%s\\n\", jarmuid,vx,vy,vz,vangle,health,color1,color2,kocsikulcsk[jarmuid],vehicleid,eladva,rendszam[jarmuid]);
format(stringx, sizeof(stringx), \"autok/%d.txt\", jarmuid);
vkfile = fopen(stringx, io_write);
    fwrite(vkfile, vkstringx);
    fclose(vkfile);
    return 1;
}
stock SaveVehiclePos3(jarmuid,eladva) //elmentés
{
new vkstringx[256];
printf(\"SaveVehiclePos3(%d,%d)\\r\\n\", jarmuid,eladva);
new Float:vx,Float:vy,Float:vz,Float:vangle,Float:health;
new model = GetVehicleModel(jarmuid);
new File: vkfile;
GetVehiclePos(jarmuid, vx,vy,vz);
GetVehicleZAngle(jarmuid, vangle);
GetVehicleHealth(jarmuid, health);
format(vkstringx, sizeof(vkstringx), \"%d,%f,%f,%f,%f,%f,%d,%d,%d,%d,%d,%s\\n\", jarmuid,vx,vy,vz,vangle,health,kocsiszink[jarmuid],kocsiszin2k[jarmuid],kocsikulcsk[jarmuid],model,eladva,rendszam[jarmuid]);
format(stringx, sizeof(stringx), \"autok/%d.txt\", jarmuid);
vkfile = fopen(stringx, io_write);
    fwrite(vkfile, vkstringx);
    fclose(vkfile);
    return 1;
}
public SaveVehiclePos2(vehicleid, jarmuid, color1, color2, eladva, Float:x, Float:y, Float:z, Float:angle) //elmentés
{
    printf(\"SaveVehiclePos2(%d,%d,%d,%d,%d,%f,%f,%f,%f)\\r\\n\", vehicleid,jarmuid,color1,color2,eladva,x,y,z,angle);
new vkstringx[256];
new File: vkfile;
format(vkstringx, sizeof(vkstringx), \"%d,%f,%f,%f,%f,%f,%d,%d,%d,%d,%d,%s\\n\", jarmuid,x,y,z,angle,1000.000,color1,color2,kocsikulcsk[jarmuid],vehicleid,eladva,rendszam[jarmuid]);
format(stringx, sizeof(stringx), \"autok/%d.txt\", jarmuid);
vkfile = fopen(stringx, io_write);
    fwrite(vkfile, vkstringx);
    fclose(vkfile);
    return 1;
}
public SaveLakasTargy(vw,objectid,model)
{
    printf(\"SaveLakasTargy(%d,%d)\\r\\n\", objectid,model);
    new savestringx[256];
new File: savefile;
new Float:X, Float:Y, Float:Z, Float:AX,Float:AY,Float:AZ;
    GetObjectPos(objectid,X,Y,Z);
    GetObjectRot(objectid,AX,AY,AZ);
    format(savestringx, sizeof(savestringx), \"%d,%f,%f,%f,%f,%f,%f,%d\\r\\n\",model,X,Y,Z,AX,AY,AZ,vw);
    savefile = fopen(\"object.txt\", io_append);
    fwrite(savefile, savestringx);
    fclose(savefile);
    return 1;
}
/*public LoadLakasTargyak()
{
    printf(\"LoadLakasTargyak()\\r\\n\");
    new arrCoords[14][64];
new strFromFile2[256];
print(\"Tárgyak beolvasása...\\r\\n\");
new File: file = fopen(\"object.txt\", io_read);
print(\"Tárgyak beolvasása megtörtént!\\r\\n\");
new Float:X, Float:Y, Float:Z, Float:AX,Float:AY,Float:AZ,objectmodel,vw;
if (file)
{
new idx;
while (idx < objectszam)
{
   fread(file, strFromFile2);
   split(strFromFile2, arrCoords, \',\');
   objectmodel = strval(arrCoords[0]);
   X = floatstr(arrCoords[1]);
   Y = floatstr(arrCoords[2]);
   Z = floatstr(arrCoords[3]);
   AX = floatstr(arrCoords[4]);
   AY = floatstr(arrCoords[5]);
   AZ = floatstr(arrCoords[6]);
   vw = strval(arrCoords[7]);
   //CreateVWDynamicObject(vw,objectmodel,X,Y,Z,AX,AY,AZ);
   idx++;
}
fclose(file);
}
return 1;
}*/
save(playerid, text[])
{
    new savestringx[256];
new File: savefile;
new Float:X, Float:Y, Float:Z, Float:A;
if(IsPlayerInAnyVehicle(playerid))
{
    new autoid, automodel;
    autoid = GetPlayerVehicleID(playerid);
    GetVehiclePos(autoid,X,Y,Z);
    automodel = GetVehicleModel(autoid);
    GetVehicleZAngle(autoid,A);
    format(savestringx, sizeof(savestringx), \"\\r\\n(%d,%f,%f,%f,%f,) // %s \",automodel,X,Y,Z,A,text);
}
else
{
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, A);
new saveskin = GetPlayerSkin(playerid);
format(savestringx, sizeof(savestringx), \"\\r\\n(%d,%f,%f,%f,%f,) // %s \",saveskin,X,Y,Z,A,text);
}
savefile = fopen(\"savedpositions.txt\", io_append);
    fwrite(savefile, savestringx);
    fclose(savefile);
    return 1;
}

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal