[Pomoc]Y_INI neki problemi ne znam kako da ih resim

Započeo Kiu
30. Jul 2016. Zaključano
351
pregleda
7
postova
Kiu
3
Wheel Man
30. Jul 2016.
Skripta koju koristim: 0
Detaljan opis problema😛re mi se desavalo da daje CJ skin neki put ne znam da li je do crasha ili je bilo do komande rcon gmx.Pa sam namestio da da skin ID 26 i da spawna igraca sa cp-om ako mu je varijabla pstigaonamarker na 0, medjutim nesto mi se izmesalo tu neki put kada ugasim exe windows posto testiram preko hamachija stavi igracu sve varijable na 0 u scriptfiles stvarno ne znam do cega je dacu vam kompletnu registraciju mozda je i do ovog saveigraca mozda nesto ne save-uje kako treba stvarno ne znam desava se i da nestanu pare.Ja ne znam kakav je taj Y_INI svi ga hvale a ja sa njim imam toliko problema.
Evo definicije

#include
#include
#include < zcmd >
#include < sscanf2 >
#include < foreach >
#include
#include

Enum pInfo i LoadUser

enum pInfo
{
pPass,
pCash,
pAdmin,
pKills,
pDeaths,
pPol,
pSkin,
pGodine,
pReg,
pSpawn,
pUzeoPutnu,
pSoba,
pTajmerZaSobu,
pLicna,
pMute,
pZatvor,
pZatvorVreme,
pWanted,
Float:pMarker[ 3 ],
pVozacka,
pOrg,
pLider,
pPosao,
pTajmerZaOpremu,
pOprema,
pStigaoNaMarker
}
new PlayerInfo;

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_String("Lozinka", PlayerInfo, 100);
INI_Int("Novac",PlayerInfo);
INI_Int("Admin",PlayerInfo);
INI_Int("Ubistva",PlayerInfo);
INI_Int("Smrti",PlayerInfo);
INI_Int("Pol",PlayerInfo);
INI_Int("Skin",PlayerInfo);
INI_Int("Godine",PlayerInfo);
INI_Int("Registrovan",PlayerInfo);
INI_Int("Spawn",PlayerInfo);
INI_Int("UzeoPutnu",PlayerInfo);
INI_Int("Soba",PlayerInfo);
INI_Int("TajmerZaSobu",PlayerInfo);
INI_Int("Licna",PlayerInfo);
INI_Int("Mute",PlayerInfo);
INI_Int("Zatvor",PlayerInfo);
INI_Int("ZatvorVreme",PlayerInfo);
INI_Int("Wanted",PlayerInfo);
INI_Float("Marker1", PlayerInfo[ playerid ][ pMarker ][ 0 ] );
INI_Float("Marker2", PlayerInfo[ playerid ][ pMarker ][ 1 ] );
INI_Float("Marker3", PlayerInfo[ playerid ][ pMarker ][ 2 ] );
INI_Int("Vozacka",PlayerInfo);
INI_Int("Org",PlayerInfo);
INI_Int("Lider",PlayerInfo);
INI_Int("Posao",PlayerInfo);
INI_Int("TajmerZaOpremu",PlayerInfo);
INI_Int("Oprema",PlayerInfo);
INI_Int("StigaoNaMarker",PlayerInfo);
return 1;
}

stock UserPath(playerid)
{
    new string,playername;
    GetPlayerName(playerid,playername,sizeof(playername));
    format(string,sizeof(string),PATH,playername);
    return string;
}

fExist

if(fexist(UserPath(playerid)))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Prijava",""COL_WHITE"Upisite lozinku da biste se prijavili.","Prijava","Izlaz");
}
else
{
ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registracija...",""COL_WHITE"Upisite lozinku da biste registrovali acc.","Registracija","Izlaz");
}

OnPlayerDisconnect

public OnPlayerDisconnect(playerid, reason)
{
Prijava = 0;
Uniforma = 0;
PonudjenaPopravka = -1;
CenaPopravke = 0;
RadiPilota = 0;
RadiRibara = 0;
UnistavanjeZakacenogObjekta(playerid);
KillTimer(Tajmer1);
KillTimer(TajmerZaRent10Min);
KillTimer(TajmerZaRent20Min);
KillTimer(TajmerZaRent30Min);
KillTimer(TajmerZaAnimaciju);
new INI:File = INI_Open(UserPath(playerid));

INI_SetTag(File,"data");
INI_WriteInt(File,"Novac",GetPlayerMoney(playerid));//ovo je dodato poslednje za novac
INI_WriteInt(File,"Admin",PlayerInfo);
INI_WriteInt(File,"Ubistva",PlayerInfo);
INI_WriteInt(File,"Smrti",PlayerInfo);
INI_WriteInt(File,"Pol",PlayerInfo);
INI_WriteInt(File,"Godine",PlayerInfo);
INI_WriteInt(File,"Registrovan",PlayerInfo);
INI_WriteInt(File,"Spawn",PlayerInfo);
INI_WriteInt(File,"UzeoPutnu",PlayerInfo);
INI_WriteInt(File,"Soba",PlayerInfo);
INI_WriteInt(File,"TajmerZaSobu",PlayerInfo);
INI_WriteInt(File,"Licna",PlayerInfo);
INI_WriteInt(File,"Mute",PlayerInfo);
INI_WriteInt(File,"Zatvor",PlayerInfo);
INI_WriteInt(File,"ZatvorVreme",PlayerInfo);
INI_WriteInt(File,"Wanted",PlayerInfo);
INI_WriteFloat( File, "Marker1", PlayerInfo[ playerid ][ pMarker ][ 0 ] );
INI_WriteFloat( File, "Marker2", PlayerInfo[ playerid ][ pMarker ][ 1 ] );
INI_WriteFloat( File, "Marker3", PlayerInfo[ playerid ][ pMarker ][ 2 ] );
INI_WriteInt(File,"Vozacka",PlayerInfo);
INI_WriteInt(File,"Org",PlayerInfo);
INI_WriteInt(File,"Lider",PlayerInfo);
INI_WriteInt(File,"Posao",PlayerInfo);
INI_WriteInt(File,"TajmerZaOpremu",PlayerInfo);
INI_WriteInt(File,"Oprema",PlayerInfo);
INI_WriteInt(File,"StigaoNaMarker",PlayerInfo);
return 1;
}

Dialog register and login

switch( dialogid )
{
case DIALOG_REGISTER:
{
if (!response) return Kick(playerid);
if(response)
{
if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registracija...",""COL_RED"Uneli ste netacnu lozinku.\n"COL_WHITE"Upisite lozinku da biste registrovali novi acc.","Registracija","Izlaz");
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteString(File,"Lozinka",inputtext);
INI_WriteInt(File,"Novac",1000);
INI_WriteInt(File,"Admin",0);
INI_WriteInt(File,"Ubistva",0);
INI_WriteInt(File,"Smrti",0);
INI_WriteInt(File,"Pol",0);
INI_WriteInt(File,"Skin",0);
INI_WriteInt(File,"Godine",0);
INI_WriteInt(File,"Registrovan",0);
INI_WriteInt(File,"Spawn",0);
INI_WriteInt(File,"UzeoPutnu",0);
INI_WriteInt(File,"Soba",0);
INI_WriteInt(File,"TajmerZaSobu",0);
INI_WriteInt(File,"Licna",0);
INI_WriteInt(File,"Mute",0);
INI_WriteInt(File,"Zatvor",0);
INI_WriteInt(File,"ZatvorVreme",0);
INI_WriteInt(File,"Wanted",0);
INI_WriteInt(File,"Marker",0);
INI_WriteInt(File,"Marker1",0);
INI_WriteInt(File,"Marker2",0);
INI_WriteInt(File,"Marker3",0);
INI_WriteInt(File,"Org",0);
INI_WriteInt(File,"Lider",0);
INI_WriteInt(File,"Posao",0);
INI_WriteInt(File,"TajmerZaOpremu",0);
INI_WriteInt(File,"StigaoNaMarker",0);
INI_Close(File);
SpawnPlayer(playerid);
GivePlayerMoney(playerid, 1000);
PlayerInfo = 1000;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo[ playerid ][ pMarker ][ 0 ] = 0.00000;
PlayerInfo[ playerid ][ pMarker ][ 1 ] = 0.00000;
PlayerInfo[ playerid ][ pMarker ][ 2 ] = 0.00000;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
PlayerInfo = 0;
SaveIgraca(playerid);
RentovanoVozilo = 299;
Prijava = 1;
GradskaVoznja = 0;
Uniforma = 0;
PonudjenaPopravka = -1;
CenaPopravke = 0;
RadiPilota = 0;
RadiRibara = 0;
SpawnPlayer(playerid);
SelectTextDraw(playerid, 0x00D900C8);
TextDrawShowForPlayer(playerid,pol1);
TextDrawShowForPlayer(playerid,pol2);
TextDrawShowForPlayer(playerid,pol3);
TextDrawShowForPlayer(playerid,pol4);
TextDrawShowForPlayer(playerid,pol5);
TextDrawShowForPlayer(playerid,pol6);
TextDrawShowForPlayer(playerid,pol7);
TextDrawShowForPlayer(playerid,pol8);
TextDrawShowForPlayer(playerid,pol9);
TextDrawShowForPlayer(playerid,pol10);
TextDrawShowForPlayer(playerid,pol11);
TextDrawShowForPlayer(playerid,pol12);
TextDrawShowForPlayer(playerid,pol13);
TextDrawShowForPlayer(playerid,pol14);
TextDrawShowForPlayer(playerid,pol15);
TextDrawShowForPlayer(playerid,pol16);
TextDrawShowForPlayer(playerid,pol17);
}
}
case DIALOG_LOGIN:
{
if ( !response ) return Kick ( playerid );
if( response )
{
if(!strcmp (inputtext, PlayerInfo, false))
{
INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);

SetPlayerSkin(playerid, PlayerInfo);
PlayerInfo = GetPlayerSkin(playerid);
GivePlayerMoney(playerid, PlayerInfo);
CancelSelectTextDraw(playerid);
Prijava = 1;
SpawnPlayer(playerid);
}
else
{
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Prijava",""COL_RED"Uneli ste netacnu lozinku.\n"COL_WHITE"Upisite lozinku da biste se registrovali.","Prijava","Izlaz");
}
return 1;
}
}
}
return 1;
}

Tajmer za save

forward TajmerZaSaveIgraca();
public TajmerZaSaveIgraca()
{
for (new i = 0; i != MAX_PLAYERS; ++i)
{
if (IsPlayerConnected(i))
{
SaveIgraca(i);
}
}
}

stock SaveIgraca(playerid)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
PlayerInfo = GetPlayerMoney(playerid);

INI_WriteInt(File,"Novac",PlayerInfo);
INI_WriteInt(File,"Admin",PlayerInfo);
INI_WriteInt(File,"Ubistva",PlayerInfo);
INI_WriteInt(File,"Smrti",PlayerInfo);
INI_WriteInt(File,"Pol",PlayerInfo);
INI_WriteInt(File,"Skin",PlayerInfo);
INI_WriteInt(File,"Godine",PlayerInfo);
INI_WriteInt(File,"Registrovan",PlayerInfo);
INI_WriteInt(File,"Spawn",PlayerInfo);
INI_WriteInt(File,"UzeoPutnu",PlayerInfo);
INI_WriteInt(File,"Soba",PlayerInfo);
INI_WriteInt(File,"TajmerZaSobu",PlayerInfo);
INI_WriteInt(File,"Licna",PlayerInfo);
INI_WriteInt(File,"Mute",PlayerInfo);
INI_WriteInt(File,"Zatvor",PlayerInfo);
INI_WriteInt(File,"ZatvorVreme",PlayerInfo);
INI_WriteInt(File,"Wanted",PlayerInfo);
INI_WriteFloat( File, "Marker1", PlayerInfo[ playerid ][ pMarker ][ 0 ] );
INI_WriteFloat( File, "Marker2", PlayerInfo[ playerid ][ pMarker ][ 1 ] );
INI_WriteFloat( File, "Marker3", PlayerInfo[ playerid ][ pMarker ][ 2 ] );
INI_WriteInt(File,"Vozacka",PlayerInfo);
INI_WriteInt(File,"Org",PlayerInfo);
INI_WriteInt(File,"Lider",PlayerInfo);
INI_WriteInt(File,"Posao",PlayerInfo);
INI_WriteInt(File,"TajmerZaOpremu",PlayerInfo);
INI_WriteInt(File,"Oprema",PlayerInfo);
INI_WriteInt(File,"StigaoNaMarker",PlayerInfo);
INI_Close(File);
return 1;
}

To bi bilo to ako je neko imao slicnih problema da mu je davalo cj skin ili da mu pare ne ucitava kako treba, ili da ga porta kao da mu je preg na 0 neka mi javi na pm ako zna resenje ovo me izludjuje dosta toga sam napravio za par dana ne zelim stati sada pocetnik sam u skriptanju zbog ovih bagova
Marko_Salvatorelo
4
Made Man
31. Jul 2016.
gde ti je public za ucitavanje podataka to jest LoadUser 😕
Darko Neskovic
4
Shot Caller
31. Jul 2016.
daj load user
Assassin007
4
Enforcer
31. Jul 2016.
INI_WriteInt(File,"Skin",26);

u Dialog respond sada neznam kako ti je s loginom
Kiu
3
Wheel Man
31. Jul 2016.

forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])
{
INI_String("Lozinka", PlayerInfo, 100);
INI_Int("Novac",PlayerInfo);
INI_Int("Admin",PlayerInfo);
INI_Int("Ubistva",PlayerInfo);
INI_Int("Smrti",PlayerInfo);
INI_Int("Pol",PlayerInfo);
INI_Int("Skin",PlayerInfo);
INI_Int("Godine",PlayerInfo);
INI_Int("Registrovan",PlayerInfo);
INI_Int("Spawn",PlayerInfo);
INI_Int("UzeoPutnu",PlayerInfo);
INI_Int("Soba",PlayerInfo);
INI_Int("TajmerZaSobu",PlayerInfo);
INI_Int("Licna",PlayerInfo);
INI_Int("Mute",PlayerInfo);
INI_Int("Zatvor",PlayerInfo);
INI_Int("ZatvorVreme",PlayerInfo);
INI_Int("Wanted",PlayerInfo);
INI_Float("Marker1", PlayerInfo[ playerid ][ pMarker ][ 0 ] );
INI_Float("Marker2", PlayerInfo[ playerid ][ pMarker ][ 1 ] );
INI_Float("Marker3", PlayerInfo[ playerid ][ pMarker ][ 2 ] );
INI_Int("Vozacka",PlayerInfo);
INI_Int("Org",PlayerInfo);
INI_Int("Lider",PlayerInfo);
INI_Int("Posao",PlayerInfo);
INI_Int("TajmerZaOpremu",PlayerInfo);
INI_Int("Oprema",PlayerInfo);
INI_Int("StigaoNaMarker",PlayerInfo);
return 1;
}
Rudimental
5
OG Legend
31. Jul 2016.
Evo ti tutorial pa prelistaj http://forum.sa-mp.com/showthread.php?t=273088
Kiu
3
Wheel Man
1. Avg. 2016.
Ne desava se vise to obrisao sam tajmer za save i stavio sam svugde gde se daju varijable ovako

// Save
new INI:file = INI_Open(UserPath(playerid));
INI_SetTag(file, "data");
INI_WriteInt(file, "Ime kako da cuva u scriptfiles", PlayerInfo);
INI_Close(file);

Tako i da ne mora da cuva preko tajmera moze i ovako za svaku komandu za sve sto se napravi on ti sacuva isto ti dodje kao i tajmer samo sto mora da save-ujes za sve sto napravis ali i nije neki veliki posao

Morate biti prijavljeni da biste odgovorili na ovu temu.

Prijava

© 2026 SmartShark. All rights reserved.

Powered by Momentum|v2026.3.001 Alpha