Szerző Téma: Kocsi rendszer  (Megtekintve 801 alkalommal)

Kocsi rendszer
« Dátum: 2014. Február 27. - 18:32:18 »
0 Show voters
Sziasztok!
Csináltam egy kocsi rendszert és a kocsi lerakása után nem frissülnek az adatok. Tudnak valaki ebben segíteni??  :shurg:
Elõre is köszönöm!
 
CMD:addv(playerid,params[])
{
new id,color1,color2,number;
if(sscanf(params,\"iiii\",number,id,color1,color2)) return SendClientMessage(playerid,-1,\"Használat:/addv [sorszám] [ModellID] [szin1] [szin2]\");
format(file,sizeof(file),\"/Kocsik/%d.txt\",number);
dini_Create(file);
Kocsi[kocsiInfo][iD] = dini_IntSet(file,\"ID\",number);
Kocsi[kocsiInfo][Modell] = dini_IntSet(file,\"Modell\",id);
Kocsi[kocsiInfo][Elado] = dini_IntSet(file,\"Elado\",1);
Kocsi[kocsiInfo][Ar] = dini_IntSet(file,\"Ar\",200);
Kocsi[kocsiInfo][Tulaj] = dini_Set(file,\"Tulaj\",\"Nincs\");
new Float:X, Float:Y, Float:Z,Float:A;
GetPlayerPos(playerid,X,Y,Z);
GetVehicleZAngle(playerid, A);
             
Kocsi[kocsiInfo][PosX] = dini_FloatSet(file,\"PosX\",X);
Kocsi[kocsiInfo][PosY] = dini_FloatSet(file,\"PosY\",Y);
Kocsi[kocsiInfo][PosZ] = dini_FloatSet(file,\"PosZ\",Z);
Kocsi[kocsiInfo][PosA] = dini_FloatSet(file,\"PosA\",A);
Kocsi[kocsiInfo][Van] = dini_IntSet(file,\"Van\",1);
Kocsi[kocsiInfo][szin1] = dini_IntSet(file,\"Szin1\",color1);
Kocsi[kocsiInfo][szin2] = dini_IntSet(file,\"Szin2\",color2);
Kocsi[kocsiInfo][COMPONENT1] = dini_IntSet(file,\"COMPONENT1\",0);
Kocsi[kocsiInfo][COMPONENT2] = dini_IntSet(file,\"COMPONENT2\",0);
Kocsi[kocsiInfo][COMPONENT3] = dini_IntSet(file,\"COMPONENT3\",0);
Kocsi[kocsiInfo][COMPONENT4] = dini_IntSet(file,\"COMPONENT4\",0);
Kocsi[kocsiInfo][COMPONENT5] = dini_IntSet(file,\"COMPONENT5\",0);
Kocsi[kocsiInfo][COMPONENT6] = dini_IntSet(file,\"COMPONENT6\",0);
Kocsi[kocsiInfo][COMPONENT7] = dini_IntSet(file,\"COMPONENT7\",0);
Kocsi[kocsiInfo][COMPONENT8] = dini_IntSet(file,\"COMPONENT8\",0);
Kocsi[kocsiInfo][COMPONENT9] = dini_IntSet(file,\"COMPONENT9\",0);
Kocsi[kocsiInfo][COMPONENT10] = dini_IntSet(file,\"COMPONENT10\",0);
UpdateVehicle(number);
             
CreateVehicle(id,Float:X,Float:Y,Float:Z,Float:PosA,color1,color2,-1);
return 1;
}
stock UpdateVehicle(Vehid)
{
new path[50];
format(path, 50,\"/Kocsik/%d.txt\",VehID);
Kocsi[Vehid][Modell] = dini_Int(path,\"Modell\");
Kocsi[Vehid][PosX] = dini_Float(path,\"PosX\");
Kocsi[Vehid][PosY] = dini_Float(path,\"PosY\");
Kocsi[Vehid][PosZ]= dini_Float(path,\"PosZ\");
Kocsi[Vehid][PosA]= dini_Float(path,\"PosA\");
Kocsi[Vehid][Van]= dini_Int(path,\"Van\");
Kocsi[Vehid][iD]= dini_Int(path,\"ID\");
Kocsi[Vehid][Ar]= dini_Int(path,\"Ar\");
Kocsi[Vehid][szin1]= dini_Int(path,\"Szin1\");
Kocsi[Vehid][szin2]= dini_Int(path,\"Szin2\");
Kocsi[Vehid][Elado]= dini_Int(path,\"Elado\");
AddVehicleComponent(Vehid, dini_Int(path,\"COMPONENT1\"));
AddVehicleComponent(Vehid, dini_Int(path,\"COMPONENT2\"));
AddVehicleComponent(Vehid, dini_Int(path,\"COMPONENT3\"));
AddVehicleComponent(Vehid, dini_Int(path,\"COMPONENT4\"));
AddVehicleComponent(Vehid, dini_Int(path,\"COMPONENT5\"));
AddVehicleComponent(Vehid, dini_Int(path,\"COMPONENT6\"));
AddVehicleComponent(Vehid, dini_Int(path,\"COMPONENT7\"));
AddVehicleComponent(Vehid, dini_Int(path,\"COMPONENT8\"));
AddVehicleComponent(Vehid, dini_Int(path,\"COMPONENT9\"));
AddVehicleComponent(Vehid, dini_Int(path,\"COMPONENT10\"));
strmid(Kocsi[Vehid][Tulaj], dini_Get(path, \"Tulaj\"), false, strlen(dini_Get(path, \"Tulaj\")), MAX_PLAYER_NAME);
if(Kocsi[Vehid][Elado] == 1)
{
vehicle3Dtext[Vehidd] = Create3DTextLabel( \"Ez a jármû eladó!\", 0x00ff09AA, 0.0, 0.0, 0.0, 50.0, 0, 1 );
Attach3DTextLabelToVehicle( vehicle3Dtext[Vehidd] , Vehid, 0.0, 0.0, 2.0);
}
return 1;
}

Kocsi rendszer
« Válasz #1 Dátum: 2014. Február 27. - 18:44:16 »
0 Show voters
elõször is:
elsõnek le kell menteni az adatatokat(én ez stock-al csinálnám, pl: AddVehicle(id,modelid,rendszam,ar,szin1,szin2);)
ezt csak simán: dini_IntSet(blablabla); ... ezt a stock-ba(persze nem muszály);
aztán az \'UpdateVehicle\'-vel a kicsi változóiba másolnám:
kocsi[id][ar] = dini_Int(blablabla);
nem tom hogy ez a gond, de azt se tom hogy ilyet lehet-e:
kocsi[id][ar] = dini_IntSet(blablabla);
ha lehet akk bocs, és nem értem mire céloztál.

Nem elérhető TheDon

  • 159
    • Profil megtekintése
Kocsi rendszer
« Válasz #2 Dátum: 2014. Február 27. - 19:01:30 »
0 Show voters
Elõször rakd le a kocsit, és csak utána szerkeszd. Máskülönben olyan mintha semmit sem csinálnál. Azért, mert elõször a SEMMI-t változtatod és leraksz egy kocsit. Szóval Rakd le, aztán módosítsd, és ha olyat módosítasz mint pl rendszám, akkor respawnold a kocsit és utána jó lesz.

Kocsi rendszer
« Válasz #3 Dátum: 2014. Február 27. - 19:05:03 »
0 Show voters
Ezt nem igazán értem tudnál írni rá egy rövidke kis példát?

Nem elérhető TheDon

  • 159
    • Profil megtekintése
Kocsi rendszer
« Válasz #4 Dátum: 2014. Február 27. - 19:12:16 »
0 Show voters
Elõször lerakod a kocsit:
 
kocsi = CreateVehicle(adatok...);

 
Utána például az alkatrészeket felrakod rá:
 
AddVehicleComponent(kocsi, object);

 
És ha a rendszámot is módosítod:
 
SetVehicleNumberPlate(kocsi, \"valami\");

 
Akkor frissíteni kell:
 
SetVehicleToRespawn(kocsi);
« Utoljára szerkesztve: 2014. Február 27. - 19:58:22 írta TheDon »

Nem elérhető Kovacs_Richard

  • 1743
  • HRP Fejlesztő
  • Discord: Kovacs_Richard#0321
    • Profil megtekintése
    • Hun Role Play Web
Kocsi rendszer
« Válasz #5 Dátum: 2014. Február 28. - 07:54:30 »
0 Show voters
elõbb változtasson rendszámot és respawnolja aztán rakja fel a tuningokat mert respawnnál eltûnnek a tuningok!
Régóta nem tevékenykedem, mint SA-MP scripter.
HRP Fejlesztő.

Nem elérhető TheDon

  • 159
    • Profil megtekintése
Kocsi rendszer
« Válasz #6 Dátum: 2014. Február 28. - 08:14:06 »
0 Show voters
A scriptjébe bele van írva hogy vissz*rakja a tuning elemeket.
E: Mármint amit pm-ben küldött.
« Utoljára szerkesztve: 2014. Február 28. - 08:15:48 írta TheDon »

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal