SA-MP Forums Archive
Y_INI [HELP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Y_INI [HELP] (/showthread.php?tid=210680)



Y_INI [HELP] - park4bmx - 13.01.2011

i am trying to save Score,Health with Y_ini & it isnt really working
This is the SCRIPT
pawn Code:
new gName[MAX_PLAYER_NAME];
new gScore;
new gMoney;

INI:UserFiles[](name[], value[])
{
    INI_String("NAME", gName, sizeof(gName));
    INI_Int("SCORE", gScore);
    INI_Int("MONEY", gMoney);
    return 0;
}

if(strcmp(cmd,"/test",true) == 0){
new INI:PlayerAccount = INI_Open("UserFiles.ini");
INI_WriteInt(PlayerAccount,"MONEY",5000);
INI_WriteInt(PlayerAccount,"SCORE",10);
INI_Close(PlayerAccount);
}



Re: Y_INI [HELP] - park4bmx - 13.01.2011

Anyone ??


Re: Y_INI [HELP] - park4bmx - 14.01.2011

PLS I NEED THIS !!!!


Re: Y_INI [HELP] - Jochemd - 14.01.2011

Where do you get gMoney and gScore (which you got double) ?


Re: Y_INI [HELP] - park4bmx - 14.01.2011

OK i changed it & still dont work ??
pawn Code:
if(strcmp(cmd,"/test",true) == 0){
new PlayerFile[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(PlayerFile,sizeof PlayerFile,"/mRegistration/%s.ini",name);
new INI:PlayerAccount = INI_Open(PlayerFile);
INI_WriteInt(PlayerAccount,"MONEY",GetPlayerMoney(playerid));
INI_WriteInt(PlayerAccount,"SCORE",GetPlayerScore(playerid));
INI_Close(PlayerAccount);
SendClientMessage(playerid,COLOR_RED,"TEST DONE");
return 1;
}



Re: Y_INI [HELP] - Jochemd - 14.01.2011

It's cause you don't get the players name.


Re: Y_INI [HELP] - park4bmx - 14.01.2011

Quote:
Originally Posted by Jochemd
View Post
It's cause you don't get the players name.
Holly S*** yeah i forgot about that THX ill see if it works


Re: Y_INI [HELP] - park4bmx - 14.01.2011

Still doesnt save ??
pawn Code:
if(strcmp(cmd,"/test",true) == 0){
new PlayerFile[128];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(PlayerFile,sizeof PlayerFile,"/mRegistration/%s.ini",name);
new INI:PlayerAccount = INI_Open(PlayerFile);
INI_WriteInt(PlayerAccount,"MONEY",GetPlayerMoney(playerid));
INI_WriteInt(PlayerAccount,"SCORE",GetPlayerScore(playerid));
INI_Close(PlayerAccount);
SendClientMessage(playerid,COLOR_RED,"TEST DONE");
return 1;
}



Re: Y_INI [HELP] - Jochemd - 14.01.2011

Is the folder created?


Re: Y_INI [HELP] - park4bmx - 14.01.2011

Quote:
Originally Posted by Jochemd
View Post
Is the folder created?
YEAH


Re: Y_INI [HELP] - Jochemd - 14.01.2011

File created?


Re: Y_INI [HELP] - park4bmx - 14.01.2011

Quote:
Originally Posted by Jochemd
View Post
File created?
No it doesnt CREAT THE FILE i tried doing it with DINI and it didnt work so what could be the problem??


Re: Y_INI [HELP] - park4bmx - 15.01.2011

Why doesnt it WORK
i am trying to save Score,Health with Y_ini & it isnt really working
This is the SCRIPT
pawn Code:
new gName[MAX_PLAYER_NAME];
new gScore;
new gMoney;

INI:UserFiles[](name[], value[])
{
    INI_String("NAME", gName, sizeof(gName));
    INI_Int("SCORE", gScore);
    INI_Int("MONEY", gMoney);
    return 0;
}

if(strcmp(cmd,"/test",true) == 0){
new INI:PlayerAccount = INI_Open("UserFiles.ini");
INI_WriteInt(PlayerAccount,"MONEY",5000);
INI_WriteInt(PlayerAccount,"SCORE",10);
INI_Close(PlayerAccount);
}
}



Re: Y_INI [HELP] - park4bmx - 15.01.2011

Anyone know what the problem is ??


Re: Y_INI [HELP] - Zh3r0 - 15.01.2011

Check this. Might help you.

https://sampforum.blast.hk/showthread.php?tid=210277