PDA

View Full Version : Change name of a .ini file via command. Help please...


introzen
29/10/2009, 09:13 PM
Hey everyone, I'm trying to make a /permname command which will set the name of a player permanently and change the players .ini file's name.

How to change the .ini file's name?

Ex. /permname Oscar_Lonhee Oscar_Dundee

Will change the file

Oscar_Lonhee.ini to Oscar_Dundee.ini


Help please =)

(.Aztec);
29/10/2009, 09:24 PM
zcmd(changename, playerid, params[])
{
new player,name[24];
if (!sscanf(params, "us", player, name))
{
if(player != INVALID_PLAYER_ID)
{
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
new string[64];
format(string, sizeof(string), "users/%s.ini", ReturnPlayerName(player));
frename(ReturnPlayerName(player),name);
SetPlayerName(player,name);
fremove(string);
format(string, sizeof(string), "Your name has been changed to %s.", name);
SendClientMessage(player, yellow, string);
}
else return SendClientMessage(playerid, red, "(Error): You are not an administrator.");
}
else return SendClientMessage(playerid, red, "(Error): Player does not exist.");
}
else return SendClientMessage(playerid, lb, "Syntax: /Changename <Player ID/Part of Name> <New Name>");
return 1;
}

introzen
29/10/2009, 09:29 PM
I don't use your kind of Functions.

I use dcmd and dini for saving and changing ini values.

Ritchie999
29/10/2009, 09:52 PM
I don't use your kind of Functions.

I use dcmd and dini for saving and changing ini values.


well, i suggest you use his function

GAMER_PS2
24/10/2011, 05:47 AM
@introzen from this days some of newbie scripters are start using ZCMD
maybe its time to use ZCMD dont you?

Joe Staff
24/10/2011, 06:04 AM
literally a 2 year old topic