[Pomoc] Y_INI

Započeo Danisha, Oktobar 05, 2016, 12:04:16 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 4 gostiju pregledaju ovu temu.

Skripta koju koristim: LARP
Detaljan opis problema: Zanima me kako bi prebacio ovu dole komadu u Y_INI iz DINI
Dio skripte:

else
{
format(string, sizeof(string), "Users/%s.ini", CarInfo[vehid][cOwner]);
if(dini_Int(string, "Vehicle") == vehid)
{
dini_IntSet(string, "Vehicle", 9999);
}
else if(dini_Int(string, "Vehicle2") == vehid)
{
dini_IntSet(string, "Vehicle2", 9999);
}
else if(dini_Int(string, "Vehicle3") == vehid)
{
dini_IntSet(string, "Vehicle3", 9999);
}
else if(dini_Int(string, "Boat") == vehid)
{
dini_IntSet(string, "Boat", 9999);
}
}


Cijela komanda:

CMD:asellcar(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
if(gPlayerLogged[playerid] == 0)
{
SCM(playerid, COLOR_GREY, "loggin");
return 1;
}
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
new string[128], sendername[MAX_PLAYER_NAME];
GetPlayerName(playerid, sendername, sizeof(sendername));
new vehid = GetPlayerVehicleID(playerid);
CarInfo[vehid][cOwned] = 0;
new ye,m,d;
new h,mi,s;
getdate(ye,m,d);
gettime(h,mi,s);
foreach(Player, i)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pVehicle] == vehid || PlayerInfo[i][pVehicle2] == vehid || PlayerInfo[i][pVehicle3] == vehid || PlayerInfo[i][pBoat] == vehid)
{
if(PlayerInfo[i][pVehicle] == vehid) PlayerInfo[i][pVehicle] = 9999;
else if(PlayerInfo[i][pVehicle2] == vehid) PlayerInfo[i][pVehicle2] = 9999;
else if(PlayerInfo[i][pVehicle3] == vehid) PlayerInfo[i][pVehicle3] = 9999;
else if(PlayerInfo[i][pBoat] == vehid) PlayerInfo[i][pBoat] = 9999;
SafeGivePlayerMoney(i, GetVehiclePrice(vehid) / 2);
}
[color=red]else
{
format(string, sizeof(string), "Users/%s.ini", CarInfo[vehid][cOwner]);
if(dini_Int(string, "Vehicle") == vehid)
{
dini_IntSet(string, "Vehicle", 9999);
}
else if(dini_Int(string, "Vehicle2") == vehid)
{
dini_IntSet(string, "Vehicle2", 9999);
}
else if(dini_Int(string, "Vehicle3") == vehid)
{
dini_IntSet(string, "Vehicle3", 9999);
}
else if(dini_Int(string, "Boat") == vehid)
{
dini_IntSet(string, "Boat", 9999);
}
}[/color]
}
}
PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
format(string, sizeof(string), "[ADMIN]: %s is sell car: [%d].", sendername, vehid);
ABroadCast(COLOR_LIGHTRED,string, 5);
SafeRemovePlayerFromVehicle(playerid);
TogglePlayerControllable(playerid, 1);
CarInfo[vehid][cOwned] = 0;
CarInfo[vehid][cOwner] = Drzava;
CarInfo[vehid][cLock] = 1;
OnPropUpdate(4, vehid);
DestroyVehicle(vehid);
CreateVehicle(522, -1336.6174, -203.8509, 5.7055, 82.2873, 0, 1, 60);
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s sell vehicle: [%d]",d,m,ye,h,mi,s,sendername,vehid);
AdminLog(string);
return 1;
}
else
{
SCM(playerid, COLOR_WHITE, "");
return 1;
}
}
return 1;
}

Neke slike/video za lakse dobivanje pomoci(neobavezno): ////
Poslednja Izmena: Oktobar 05, 2016, 12:05:34 POSLE PODNE od Danisha

ovo je nagrubo uradjeno jer niko nece raditi zadacu za tebe, ovako nesto bi trebalo da funkcionise, pa probaj... [pawn]else
               {
                  format(string, sizeof(string), "Users/%s.ini", CarInfo[vehid][cOwner]);
                  new INI:inif = INI_Open(string);
                  new vvehid;
                  INI_Int("Vehicle",vvehid);
                  new vvehid2;
                  INI_Int("Vehicle2",vvehid);
                  new vvehid3;
                  INI_Int("Vehicle3",vvehid);
                  new boatt;
                  INI_Int("Boat",boatt);
                  if(vvehid == vehid)
                  {
                     INI_WriteInt(inif, "Vehicle", 9999);
                  }
                  else if(vvehid2 == vehid)
                  {
                     INI_WriteInt(inif, "Vehicle2", 9999);
                  }
                  else if(vvehid3 == vehid)
                  {
                     INI_WriteInt(inif, "Vehicle3", 9999);
                  }
                  else if(dini_Int(string, "Boat") == vehid)
                  {
                     INI_WriteInt(inif, "Boat", 9999);
                  }
               }[/pawn]

My Bike KTM 450 SXF 2008

Citat: Vuzimir poslato Oktobar 05, 2016, 16:43:19 POSLE PODNE
ovo je nagrubo uradjeno jer niko nece raditi zadacu za tebe, ovako nesto bi trebalo da funkcionise, pa probaj... [pawn]else
               {
                  format(string, sizeof(string), "Users/%s.ini", CarInfo[vehid][cOwner]);
                  new INI:inif = INI_Open(string);
                  new vvehid;
                  INI_Int("Vehicle",vvehid);
                  new vvehid2;
                  INI_Int("Vehicle2",vvehid);
                  new vvehid3;
                  INI_Int("Vehicle3",vvehid);
                  new boatt;
                  INI_Int("Boat",boatt);
                  if(vvehid == vehid)
                  {
                     INI_WriteInt(inif, "Vehicle", 9999);
                  }
                  else if(vvehid2 == vehid)
                  {
                     INI_WriteInt(inif, "Vehicle2", 9999);
                  }
                  else if(vvehid3 == vehid)
                  {
                     INI_WriteInt(inif, "Vehicle3", 9999);
                  }
                  else if(dini_Int(string, "Boat") == vehid)
                  {
                     INI_WriteInt(inif, "Boat", 9999);
                  }
               }[/pawn]

Drugar sta bi sa ovom linijicom :D

else if(dini_Int(string, "Boat") == vehid)

Citat: á"•á™"á'ªá"°á™¢á—¢á¯á"°á'•â,,¢ ãƒ,, poslato Oktobar 05, 2016, 16:44:47 POSLE PODNE
Drugar sta bi sa ovom linijicom :D

else if(dini_Int(string, "Boat") == vehid)

ala druze nije retard da ne zna prepraviti kao gore, rekao sam da sam to uradio nagrubo (u notepad++ bez kompaliranja) mora biti gresaka cak i errora...

My Bike KTM 450 SXF 2008

Citat: Vuzimir poslato Oktobar 05, 2016, 16:48:04 POSLE PODNE
Citat: á"•á™"á'ªá"°á™¢á—¢á¯á"°á'•â,,¢ ãƒ,, poslato Oktobar 05, 2016, 16:44:47 POSLE PODNE
Drugar sta bi sa ovom linijicom :D

else if(dini_Int(string, "Boat") == vehid)

ala druze nije retard da ne zna prepraviti kao gore, rekao sam da sam to uradio nagrubo (u notepad++ bez kompaliranja) mora biti gresaka cak i errora...

Resicu mu ja , ako mu ovo nije pomoglo jer sam na fonu pa me mrzi jbano pisati..

Jel za ovo INI_Int ne treba ovde INI_ParseFile, a ovo INI_Open je za INI_WriteInt?


Evo ti dokumentacija pa pregledaj
https://wiki.sa-mp.com/wiki/YSI:INI

"They have computers, and they may have other weapons of mass destruction."