SA-MP Forums Archive
Change name of a .ini file via command. Help please... - 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: Change name of a .ini file via command. Help please... (/showthread.php?tid=105555)



Change name of a .ini file via command. Help please... - introzen - 29.10.2009

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 =)


Re: Change name of a .ini file via command. Help please... - (.Aztec); - 29.10.2009

pawn Код:
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;
}



Re: Change name of a .ini file via command. Help please... - introzen - 29.10.2009

I don't use your kind of Functions.

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


Re: Change name of a .ini file via command. Help please... - Ritchie999 - 29.10.2009

Quote:
Originally Posted by IntrozeN
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


Re: Change name of a .ini file via command. Help please... - GAMER_PS2 - 24.10.2011

@introzen from this days some of newbie scripters are start using ZCMD
maybe its time to use ZCMD dont you?


Re: Change name of a .ini file via command. Help please... - Joe Staff - 24.10.2011

literally a 2 year old topic