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)
+--- Thread: Y_ini help! (
/showthread.php?tid=316554)
Y_ini help! -
Ballu Miaa - 07.02.2012
Hello,
How can i copy the name of the userfile and create a new file with the same name??
This is what i was using in /setname with dini
pawn Код:
format(string, sizeof(string), "%s.ini", PlayerName(giveplayerid));
dini_Remove(string);// How can i do this with y_ini
format(string2, sizeof(string2), "%s.ini", tmp);
dini_Create(string2); // How can i do this with y_ini
Please help me to understand this. Thanks !
- Ballu Miaa
Re: Y_ini help! -
Madd Kat - 07.02.2012
are you using y_ini or d_ini?
i would load all the info for the ini then use the code that creates the ini with the new name then
use this to delete the old file
https://sampwiki.blast.hk/wiki/Fremove
Re: Y_ini help! -
Konstantinos - 07.02.2012
Get player's name and store it in a variable. Then SetPlayerName( The ID of the player to set the name of, The name to set ); and GetPlayerName (to get the new name) and create the new file with the name.
Last use fremove to delete the account from the first player's name.
pawn Код:
// Setname Command
new
id, Name[ MAX_PLAYER_NAME ], NewName[ MAX_PLAYER_NAME ], string[ 32 ], str[ 32 ], varname[ 24 ];
GetPlayerName( id, Name, MAX_PLAYER_NAME );
format( string, sizeof( string ), "Users\%s.ini", Name );
SetPlayerName( id, varname );
GetPlayerName( id, NewName, MAX_PLAYER_NAME );
format( str, sizeof( str ), "Users\%s.ini", NewName ); // The File Location
new INI:File = INI_Open( str );
// Rest
INI_Close(file);
fremove( string ); // Remove the first Account Name
Re: Y_ini help! -
IceCube! - 07.02.2012
Edit: removed already solved.