SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 13/01/2011, 05:04 PM   #1
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,364
Reputation: 240
Question Y_INI [HELP]

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);
}

Last edited by park4bmx; 15/01/2011 at 03:17 PM.
park4bmx is offline  
Old 13/01/2011, 05:58 PM   #2
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,364
Reputation: 240
Default Re: Y_INI [HELP]

Anyone ??
park4bmx is offline  
Old 14/01/2011, 03:25 PM   #3
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,364
Reputation: 240
Default Re: Y_INI [HELP]

PLS I NEED THIS !!!!
park4bmx is offline  
Old 14/01/2011, 03:29 PM   #4
Jochemd
High-roller
 
Jochemd's Avatar
 
Join Date: Jul 2009
Location: The Netherlands
Posts: 2,220
Reputation: 844
Default Re: Y_INI [HELP]

Where do you get gMoney and gScore (which you got double) ?
__________________
Jochemd is offline  
Old 14/01/2011, 04:05 PM   #5
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,364
Reputation: 240
Exclamation Re: Y_INI [HELP]

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;
}
park4bmx is offline  
Old 14/01/2011, 04:06 PM   #6
Jochemd
High-roller
 
Jochemd's Avatar
 
Join Date: Jul 2009
Location: The Netherlands
Posts: 2,220
Reputation: 844
Default Re: Y_INI [HELP]

It's cause you don't get the players name.
__________________
Jochemd is offline  
Old 14/01/2011, 04:08 PM   #7
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,364
Reputation: 240
Default Re: Y_INI [HELP]

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
park4bmx is offline  
Old 14/01/2011, 04:16 PM   #8
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,364
Reputation: 240
Default Re: Y_INI [HELP]

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;
}
park4bmx is offline  
Old 14/01/2011, 04:29 PM   #9
Jochemd
High-roller
 
Jochemd's Avatar
 
Join Date: Jul 2009
Location: The Netherlands
Posts: 2,220
Reputation: 844
Default Re: Y_INI [HELP]

Is the folder created?
__________________
Jochemd is offline  
Old 14/01/2011, 04:57 PM   #10
park4bmx
High-roller
 
park4bmx's Avatar
 
Join Date: Dec 2009
Location: Samokov,Bulgaria
Posts: 2,364
Reputation: 240
Default Re: Y_INI [HELP]

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Y_ini help. Haydz Help Archive 0 12/01/2011 11:35 AM
dini_Exists in y_ini GiS Help Archive 18 08/01/2011 04:54 PM
Y_Ini. Zh3r0 Help Archive 1 15/10/2010 09:00 PM


All times are GMT. The time now is 07:49 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.