ownership creating file[I use Y_Ini]
#1

Hello everyone this is my big problem that I can't fix so when I buy a bike car or helicopter I want when one player buy examplee car then in the folder for cars I want to create Car_0 and second player buy car then create a file Car_1 do you know what I want I have that but he problem is I bu car oke in the folder is created Car_0 but when my friend buy a car they should be created in the folder Car_1 but it's replace with my if you know what I mean. Tjanks
Reply
#2

Show us the script please? of /buycar or w/e and the load/save.
Reply
#3

this is when player buy a car

[PAAWN]if(dialogid == 262 && response)
{
new i = GetFreeMoID();
new v = GetNextID();
new le = GetFreeLetID();
new p = GetFreeBoID();
switch(listitem)
{
case 0:
{
if(BiraVozilo[playerid] >= GLEDA_SPORTSKA && BiraVozilo[playerid] <= GLEDA_KARAVANE)
{
if(PlayerInfo[playerid][Auto1] != -1) return SCM(playerid, GRAD2, "{F81414}[Greska!] {C3C3C3}Vec posjedujete vozilo!");
if(PlayerInfo[playerid][pCash] < hBiraCenaKes[playerid])
{
SCM(playerid, GRAD2, "{F81414}[Greska!] {C3C3C3}Nemate dovoljno novca za ovo!");
return 1;
}
for(new s = 0; s < 1000; s++)
{
if(AutomobilZauzet[s] == 0)
{
i = s;
break;
}
else continue;
}
//if(i == -1) return SCM(playerid, CRVENA, "Prekoracen je limit vozila, obavesti head admina o ovome!");
AutomobilZauzet[v] = 1;
PlayerInfo[playerid][Auto1] = v;
IgracevAuto1[playerid] = v;
SetPlayerPos(playerid, 1072.8944,-1772.2209,13.3504);
SetPlayerFacingAngle(playerid, 0);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 1);
AutosalonTD(playerid, 0);
BiraVozilo[playerid] = 0;
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
DestroyVehicle(IzlozbenoVozilo[playerid]);
GivePlayerMoney(playerid, -hBiraCenaKes[playerid]);
PodesiAuto(playerid, v);
new huIme[MAX_PLAYER_NAME];
RPIme(playerid, huIme);
//new rand = 10000 + random(89999), tablica[9];
//format(tablica, 9, "LS %d", rand);
//new pozc = random(sizeof(PozicijeAutomobila));
VInfo[v][hModel] = hBiraModel[playerid];
//VInfo[v][hPozX] = PozicijeAutomobila[pozc][0];
//VInfo[v][hPozY] = PozicijeAutomobila[pozc][1];
//VInfo[v][hPozZ] = PozicijeAutomobila[pozc][2];
//VInfo[v][hPozA] = PozicijeAutomobila[pozc][3];
VInfo[v][hPaintJob] = 0;
VInfo[v][hsKomponenta1] = 0;
VInfo[v][hsKomponenta2] = 0;
VInfo[v][hsKomponenta3] = 0;
VInfo[v][hsKomponenta4] = 0;
VInfo[v][hsKomponenta5] = 0;
VInfo[v][hsKomponenta6] = 0;
VInfo[v][hsKomponenta7] = 0;
VInfo[v][hsKomponenta8] = 0;
VInfo[v][hsKomponenta9] = 0;
VInfo[v][hsKomponenta10] = 0;
VInfo[v][hsKomponenta11] = 0;
VInfo[v][hsKomponenta12] = 0;
VInfo[v][hsKomponenta13] = 0;
VInfo[v][hBoja1] = 0;
VInfo[v][hBoja2] = 0;
strmid(VInfo[v][hVlasnik], huIme, 0, strlen(huIme), 255);
strmid(VInfo[v][hOpis], ImenaVozila[hBiraModel[playerid] - 400], 0, strlen(ImenaVozila[hBiraModel[playerid] - 400]), 255);
VInfo[v][hck] = hBiraCenaKes[playerid];
VInfo[v][hcg] = hBiraCenaGold[playerid];
VInfo[v][hImaVlasnika] = 1;
//strmid(VInfo[v][hTablice], tablica, 0, strlen(tablica), 255);
VInfo[v][hvw] = 0;
VInfo[v][hent] = 0;
VInfo[v][hZakljucan] = 0;
PlayerInfo[playerid][VoziloZakljucano] = 0;
//VInfo[v][ownedvehicle] = CreateVehicle_H(VInfo[v][hModel], VInfo[v][hPozX], VInfo[v][hPozY], VInfo[v][hPozZ], VInfo[v][hPozA], VInfo[v][hBoja1], VInfo[v][hBoja2], 300000);
//SetVehicleNumberPlate(VInfo[v][ownedvehicle], VInfo[v][hTablice]);
//SetVehicleToRespawn(VInfo[v][ownedvehicle]);
//SetPlayerCheckpoint(playerid, VInfo[v][hPozX], VInfo[v][hPozY], VInfo[v][hPozZ], 10.0);
SCM(playerid, BELA, "Cestitamo na kupovini vozila!");
SCM(playerid, BELA, "Komande su: /v(ozilo)!");
SCM(playerid, ZUTA, "Ovo je vasa prva kupnja. Da kreirate vase vozilo, kucajte /v kreiraj!");
VozilaUSalonu--;
IgracevAuto1[playerid] = v;
TextDrawHideForPlayer(playerid, Textdraw10[playerid]);
TextDrawHideForPlayer(playerid, Textdraw11[playerid]);
TextDrawHideForPlayer(playerid, Textdraw12[playerid]);
TextDrawHideForPlayer(playerid, Textdraw13[playerid]);
}[/PAWN]
Reply
#4

well, first add this to the defines:
pawn Код:
MAX_V 1000 // max amounts
Well, i dont think it works correctly, since i dont understand your language.
pawn Код:
if(dialogid == 262 && response)
{
new i = GetFreeMoID();
new v = GetNextID();
new le = GetFreeLetID();
new p = GetFreeBoID();
for(new v=1; v<MAX_V; v++) //
switch(listitem)
{
case 0:
{
if(BiraVozilo[playerid] >= GLEDA_SPORTSKA && BiraVozilo[playerid] <= GLEDA_KARAVANE)
{
if(PlayerInfo[playerid][Auto1] != -1) return SCM(playerid, GRAD2, "{F81414}[Greska!] {C3C3C3}Vec posjedujete vozilo!");
if(PlayerInfo[playerid][pCash] < hBiraCenaKes[playerid])
{
SCM(playerid, GRAD2, "{F81414}[Greska!] {C3C3C3}Nemate dovoljno novca za ovo!");
return 1;
}
for(new s = 0; s < 1000; s++)
{
if(AutomobilZauzet[s] == 0)
{
i = s;
break;
}
else continue;
}
//if(i == -1) return SCM(playerid, CRVENA, "Prekoracen je limit vozila, obavesti head admina o ovome!");
AutomobilZauzet[v] = 1;
PlayerInfo[playerid][Auto1] = v;
IgracevAuto1[playerid] = v;
SetPlayerPos(playerid, 1072.8944,-1772.2209,13.3504);
SetPlayerFacingAngle(playerid, 0);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid, 1);
AutosalonTD(playerid, 0);
BiraVozilo[playerid] = 0;
SetPlayerVirtualWorld(playerid, 0);
SetPlayerInterior(playerid, 0);
DestroyVehicle(IzlozbenoVozilo[playerid]);
GivePlayerMoney(playerid, -hBiraCenaKes[playerid]);
PodesiAuto(playerid, v);
new huIme[MAX_PLAYER_NAME];
RPIme(playerid, huIme);
//new rand = 10000 + random(89999), tablica[9];
//format(tablica, 9, "LS %d", rand);
//new pozc = random(sizeof(PozicijeAutomobila));
VInfo[v][hModel] = hBiraModel[playerid];
//VInfo[v][hPozX] = PozicijeAutomobila[pozc][0];
//VInfo[v][hPozY] = PozicijeAutomobila[pozc][1];
//VInfo[v][hPozZ] = PozicijeAutomobila[pozc][2];
//VInfo[v][hPozA] = PozicijeAutomobila[pozc][3];
VInfo[v][hPaintJob] = 0;
VInfo[v][hsKomponenta1] = 0;
VInfo[v][hsKomponenta2] = 0;
VInfo[v][hsKomponenta3] = 0;
VInfo[v][hsKomponenta4] = 0;
VInfo[v][hsKomponenta5] = 0;
VInfo[v][hsKomponenta6] = 0;
VInfo[v][hsKomponenta7] = 0;
VInfo[v][hsKomponenta8] = 0;
VInfo[v][hsKomponenta9] = 0;
VInfo[v][hsKomponenta10] = 0;
VInfo[v][hsKomponenta11] = 0;
VInfo[v][hsKomponenta12] = 0;
VInfo[v][hsKomponenta13] = 0;
VInfo[v][hBoja1] = 0;
VInfo[v][hBoja2] = 0;
strmid(VInfo[v][hVlasnik], huIme, 0, strlen(huIme), 255);
strmid(VInfo[v][hOpis], ImenaVozila[hBiraModel[playerid] - 400], 0, strlen(ImenaVozila[hBiraModel[playerid] - 400]), 255);
VInfo[v][hck] = hBiraCenaKes[playerid];
VInfo[v][hcg] = hBiraCenaGold[playerid];
VInfo[v][hImaVlasnika] = 1;
//strmid(VInfo[v][hTablice], tablica, 0, strlen(tablica), 255);
VInfo[v][hvw] = 0;
VInfo[v][hent] = 0;
VInfo[v][hZakljucan] = 0;
PlayerInfo[playerid][VoziloZakljucano] = 0;
//VInfo[v][ownedvehicle] = CreateVehicle_H(VInfo[v][hModel], VInfo[v][hPozX], VInfo[v][hPozY], VInfo[v][hPozZ], VInfo[v][hPozA], VInfo[v][hBoja1], VInfo[v][hBoja2], 300000);
//SetVehicleNumberPlate(VInfo[v][ownedvehicle], VInfo[v][hTablice]);
//SetVehicleToRespawn(VInfo[v][ownedvehicle]);
//SetPlayerCheckpoint(playerid, VInfo[v][hPozX], VInfo[v][hPozY], VInfo[v][hPozZ], 10.0);
SCM(playerid, BELA, "Cestitamo na kupovini vozila!");
SCM(playerid, BELA, "Komande su: /v(ozilo)!");
SCM(playerid, ZUTA, "Ovo je vasa prva kupnja. Da kreirate vase vozilo, kucajte /v kreiraj!");
VozilaUSalonu--;
IgracevAuto1[playerid] = v;
TextDrawHideForPlayer(playerid, Textdraw10[playerid]);
TextDrawHideForPlayer(playerid, Textdraw11[playerid]);
TextDrawHideForPlayer(playerid, Textdraw12[playerid]);
TextDrawHideForPlayer(playerid, Textdraw13[playerid]);
}
[/pawn]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)