[POMOC] Auta

Započeo Mr.Glavonja, Februar 15, 2012, 21:44:26 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 2 gostiju pregledaju ovu temu.

Skripta koju koristim:BN
Detaljan opis problema:Pa ovako vecini igraca nestaju auta. Znaci kada izadju sa servera i kasnije ponovo udju pise im da ne posjeduju auto
Dio skripte:nezz sta treba
Neke slike/video za lakse dobivanje pomoci(neobavezno)://
______________________________________________
Havana RolePlay 0.3z
Server IP: 193.192.59.222:7778
Forum: Uskoro
TeamSpeak: Uskoro!
Otvorenje: 27.02.2014
_____________________________________________

[BT:RP] Mayor !

pa daj dio skripte carownership

pa napravi tako da kad izadju da im vozilo bude sacuvano i daj dio ownership-a da vidimo kamo trebas stavi!

Evo ako je to to :D
new Float:VehPosX[MAX_VEHICLES], Float:VehPosY[MAX_VEHICLES], Float:VehPosZ[MAX_VEHICLES];
stock LuX_ReadPosition(vehicleid)
{
    new Float:LReadX, Float:LReadY, Float:LReadZ;
    GetVehiclePos(vehicleid, LReadX, LReadY, LReadZ);
VehPosX[vehicleid]=LReadX; VehPosY[vehicleid]=LReadY; VehPosZ[vehicleid]=LReadZ;
}
stock UcitajVozilo(playerid)
{
new dateiname[128+4];
new playername[MAX_PLAYER_NAME+100];

Carlist[playerid][Typ]=-1; Carlist[playerid][X]=0.0; Carlist[playerid][Y]=0.0; Carlist[playerid][Z]=0.0;
Carlist[playerid][Rotation]=0.0; Carlist[playerid][Status]=0; Carlist[playerid][Lock]=0; Carlist[playerid][Carid]=-1;
Carlist[playerid][Color1]=-1; Carlist[playerid][Color2]=-1; Carlist[playerid][mod1]=-1; Carlist[playerid][mod2]=-1;
Carlist[playerid][mod3]=-1; Carlist[playerid][mod4]=-1; Carlist[playerid][mod5]=-1; Carlist[playerid][mod6]=-1;
Carlist[playerid][mod7]=-1; Carlist[playerid][mod8]=-1; Carlist[playerid][mod9]=-1; Carlist[playerid][mod10]=-1;
Carlist[playerid][mod11]=-1; Carlist[playerid][mod12]=-1; Carlist[playerid][mod13]=-1; Carlist[playerid][mod14]=-1;
Carlist[playerid][mod15]=-1; Carlist[playerid][mod16]=-1; Carlist[playerid][mod17]=-1; Carlist[playerid][Paintjob]=-1;
Spectating[playerid][0]=-1; Carlist[playerid][BrojRegistracije] = -1;
#if defined CARSELL
offerCar[playerid]={-1,0};
#endif
GetPlayerName(playerid, playername, sizeof(playername));
CheckRPName(playerid, playername);
format(dateiname, sizeof(dateiname), "Vozila/%s.automobil", playername);
if (fexist(dateiname))
{
new File: CarFile = fopen(dateiname, io_read);
if ( CarFile )
{
    new key[ 256 ];
    new Data[ 256 ] , val[ 256];
   
    while ( fread( CarFile , Data , sizeof( Data ) ) )
{
key = ini_GetKey(Data);
if(strcmp(key,"AH_Typ",true)==0) { Carlist[playerid][Typ]=strval(ini_GetValue(Data)); }
else if(strcmp(key,"AH_Vmodel",true)==0) { Carlist[playerid][VehModel]=strval(ini_GetValue(Data)); }
else if(strcmp(key ,"AH_Vlasnik",true)== 0) { val = ini_GetValue( Data ); strmid(Carlist[playerid][Vlasnik], val, 0, strlen(val)-1, 255); }
//else if(strcmp(key,"AH_Vlasnik",true)==0) { Carlist[playerid][Vlasnik]=strlen(ini_GetValue(Data)); }
else if(strcmp(key ,"AH_BrojRegistracije",true)== 0) { val = ini_GetValue( Data ); strmid(Carlist[playerid][BrojRegistracije], val, 0, strlen(val)-1, 255); }
//else if(strcmp(key,"AH_BrojRegistracije",true)==0) { Carlist[playerid][BrojRegistracije]=strlen(ini_GetValue(Data)); }
else if(strcmp(key,"AH_Cijena",true)==0) { Carlist[playerid][Cijena]=strval(ini_GetValue(Data)); }
else if(strcmp(key,"AH_VMaterijali",true)==0) { Carlist[playerid][CarMats]=strval(ini_GetValue(Data)); }
else if(strcmp(key,"AH_VDroga",true)==0) { Carlist[playerid][CarDroga]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_X",true)==0) { Carlist[playerid][X]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Y",true)==0) { Carlist[playerid][Y]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Z",true)==0) { Carlist[playerid][Z]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Rot",true)==0) { Carlist[playerid][Rotation]=floatstr(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Status",true)==0) { Carlist[playerid][Status]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Lock",true)==0) { Carlist[playerid][Lock]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Paintjob",true)==0) { Carlist[playerid][Paintjob]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Color1",true)==0) { Carlist[playerid][Color1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_Color2",true)==0) { Carlist[playerid][Color2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod1",true)==0) { Carlist[playerid][mod1]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod2",true)==0) { Carlist[playerid][mod2]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod3",true)==0) { Carlist[playerid][mod3]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod4",true)==0) { Carlist[playerid][mod4]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod5",true)==0) { Carlist[playerid][mod5]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod6",true)==0) { Carlist[playerid][mod6]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod7",true)==0) { Carlist[playerid][mod7]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod8",true)==0) { Carlist[playerid][mod8]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod9",true)==0) { Carlist[playerid][mod9]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod10",true)==0) { Carlist[playerid][mod10]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod11",true)==0) { Carlist[playerid][mod11]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod12",true)==0) { Carlist[playerid][mod12]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod13",true)==0) { Carlist[playerid][mod13]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod14",true)==0) { Carlist[playerid][mod14]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod15",true)==0) { Carlist[playerid][mod15]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod16",true)==0) { Carlist[playerid][mod16]=strval(ini_GetValue(Data)); }
    else if(strcmp(key,"AH_mod17",true)==0) { Carlist[playerid][mod17]=strval(ini_GetValue(Data)); }
}
}
    fclose(CarFile);
    if(Carlist[playerid][Typ]!=-1)
    {
Carlist[playerid][Carid] +=1;
        Carlist[playerid][Carid]=CreateTunedCar(playerid);
SetVehicleNumberPlate(Carlist[playerid][Carid], Carlist[playerid][BrojRegistracije]);
}
}
return 1;
}


I ovo OnPlayerDisconect

public OnPlayerDisconnect(playerid)
{

new dateiname[MAX_PLAYER_NAME+46];
new playername[MAX_PLAYER_NAME];
new var[128];
    GetPlayerName(playerid, playername, sizeof(playername));
format(dateiname, sizeof(dateiname), "Vozila/%s.automobil", playername);
new File: CarFile = fopen(dateiname, io_write);
    format(var, 256, "AH_Typ=%i\n", Carlist[playerid][Typ]); fwrite(CarFile, var);
format(var, 256, "AH_Vmodel=%i\n", Carlist[playerid][VehModel]); fwrite(CarFile, var);
format(var, 256, "AH_Vlasnik=%s\n", Carlist[playerid][Vlasnik]); fwrite(CarFile, var);
format(var, 256, "AH_BrojRegistracije=%s\n", Carlist[playerid][BrojRegistracije]); fwrite(CarFile, var);
format(var, 256, "AH_VCijena=%i\n", Carlist[playerid][Cijena]); fwrite(CarFile, var);
format(var, 256, "AH_Matsi=%i\n", Carlist[playerid][CarMats]); fwrite(CarFile, var);
format(var, 256, "AH_Droga=%i\n", Carlist[playerid][CarDroga]); fwrite(CarFile, var);
    format(var, 256, "AH_X=%f\n", Carlist[playerid][X]); fwrite(CarFile, var);
format(var, 256, "AH_Y=%f\n", Carlist[playerid][Y]); fwrite(CarFile, var);
format(var, 256, "AH_Z=%f\n", Carlist[playerid][Z]); fwrite(CarFile, var);
format(var, 256, "AH_Rot=%f\n", Carlist[playerid][Rotation]); fwrite(CarFile, var);
format(var, 256, "AH_Status=%i\n", Carlist[playerid][Status]); fwrite(CarFile, var);
format(var, 256, "AH_Lock=%i\n", Carlist[playerid][Lock]); fwrite(CarFile, var);
format(var, 256, "AH_Paintjob=%i\n", Carlist[playerid][Paintjob]); fwrite(CarFile, var);
format(var, 256, "AH_Color1=%i\n", Carlist[playerid][Color1]); fwrite(CarFile, var);
format(var, 256, "AH_Color2=%i\n", Carlist[playerid][Color2]); fwrite(CarFile, var);
format(var, 256, "AH_mod1=%i\n", Carlist[playerid][mod1]); fwrite(CarFile, var);
format(var, 256, "AH_mod2=%i\n", Carlist[playerid][mod2]); fwrite(CarFile, var);
format(var, 256, "AH_mod3=%i\n", Carlist[playerid][mod3]); fwrite(CarFile, var);
format(var, 256, "AH_mod4=%i\n", Carlist[playerid][mod4]); fwrite(CarFile, var);
format(var, 256, "AH_mod5=%i\n", Carlist[playerid][mod5]); fwrite(CarFile, var);
format(var, 256, "AH_mod6=%i\n", Carlist[playerid][mod6]); fwrite(CarFile, var);
format(var, 256, "AH_mod7=%i\n", Carlist[playerid][mod7]); fwrite(CarFile, var);
format(var, 256, "AH_mod8=%i\n", Carlist[playerid][mod8]); fwrite(CarFile, var);
format(var, 256, "AH_mod9=%i\n", Carlist[playerid][mod9]); fwrite(CarFile, var);
format(var, 256, "AH_mod10=%i\n", Carlist[playerid][mod10]); fwrite(CarFile, var);
format(var, 256, "AH_mod11=%i\n", Carlist[playerid][mod11]); fwrite(CarFile, var);
format(var, 256, "AH_mod12=%i\n", Carlist[playerid][mod12]); fwrite(CarFile, var);
format(var, 256, "AH_mod13=%i\n", Carlist[playerid][mod13]); fwrite(CarFile, var);
format(var, 256, "AH_mod14=%i\n", Carlist[playerid][mod14]); fwrite(CarFile, var);
format(var, 256, "AH_mod15=%i\n", Carlist[playerid][mod15]); fwrite(CarFile, var);
format(var, 256, "AH_mod16=%i\n", Carlist[playerid][mod16]); fwrite(CarFile, var);
format(var, 256, "AH_mod17=%i\n", Carlist[playerid][mod17]); fwrite(CarFile, var);
    fclose(CarFile);
    if(Carlist[playerid][Carid]!=-1)
{
SetVehicleParamsForAll(Carlist[playerid][Carid],0,0);
DestroyVehicle(Carlist[playerid][Carid]);
Carlist[playerid][Carid]=-1;
}


I Evo iz scriptifles Vozila
AH_Typ=-1
AH_VModel=0
AH_Vlasnik=
AH_BrojRegistracije=ÿ
AH_Cijena=0
AH_Matsi=0
AH_Droga=0
AH_X=0.000000
AH_Y=0.000000
AH_Z=0.000000
AH_Rot=0.000000
AH_Status=0
AH_Lock=0
AH_Paintjob=-1
AH_Color1=-1
AH_Color2=-1
AH_mod1=-1
AH_mod2=-1
AH_mod3=-1
AH_mod4=-1
AH_mod5=-1
AH_mod6=-1
AH_mod7=-1
AH_mod8=-1
AH_mod9=-1
AH_mod10=-1
AH_mod11=-1
AH_mod12=-1
AH_mod13=-1
AH_mod14=-1
AH_mod15=-1
AH_mod16=-1
AH_mod17=-1



Poslednja Izmena: Februar 15, 2012, 23:10:29 POSLE PODNE od Mr.Glavonja
______________________________________________
Havana RolePlay 0.3z
Server IP: 193.192.59.222:7778
Forum: Uskoro
TeamSpeak: Uskoro!
Otvorenje: 27.02.2014
_____________________________________________