Command changename in y_ini please
#1

I need the command name to y_ini.
I can not find it anywhere, because furthermore I need statistics to be saved.

Thanks!
Reply
#2

pawn Код:
#define DIALOG_CHANGENICK 0

CMD:changenick(playerid,params[])
{
    ShowPlayerDialog(playerid, DIALOG_CHANGENICK, DIALOG_STYLE_INPUT,"Change Nick","Please enter below your nick !","Select","Exit");
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    if(dialogid == DIALOG_CHANGENICK)
    {
        if(response)
        {
            if(!strlen(inputtext))
            {
                SetPlayerName(playerid, inputtext);
                SendClientMessage(playerid, -1, "{FF0000}Succes: {15FF00}You have succesfully changed your name !");
            }
        }
    }
    return 1;
}
I never learned Y_Ini, so you can change:

pawn Код:
CMD:changenick(playerid,params[])
To Y_INI command starter:

pawn Код:
Y:INI:changenick(playerid,params[]) // I don't know :D
I made him in Dialogs, and it's very simple, you can optimize him.

P.S: Works fine. If don't work, some of your filescripts it's blocking him .
Reply
#3

Oh god!!!
Y_ini is a saving system, not a command processor....
Reply
#4

pawn Код:
CMD:setname (playerid, params[])

{
    new id, name[25],str[120];
    if(sscanf(params, "us[25]", id))return SendClientMessage(playerid, COLOR_RED, "Error: Usage: /Setname [id]");

    if(strlen(name) < 3)return SendClientMessage(playerid, COLOR_RED, "Error: The length of name is lower than 3!");
    if(strlen(name) > MAX_PLAYER_NAME)return SendClientMessage(playerid, COLOR_RED, "Error: The length of name exceeds the limit!");
    new file[64];
    format(file, sizeof(file), "/Users/%s.ini", name);// change it to your User Path
    if (fexist(file)) return SendClientMessage(playerid, COLOR_RED, "Error: That name is already in use!");
    fremove(UserPath(id));// UserPath is a stock in my code you can change it to your's
    SetPlayerName(id,name);
        //and save the stats of player like you do in OnPlayerDisconnect
//Example:
        SaveStats(id);
    return 1;
}
Hope you will not understand it... because you beg for codes.. instead of googling or learning it..
Reply
#5

look, this look so normal?

Код:
CMD:name(playerid, params[])
{
	new newname[24];
    if(sscanf(params,"s[24]", newname)) return SendClientMessage(playerid, -1 , ""RO"* Uso: /name <new name>");
    new filestring2[128];
    format(filestring2, sizeof(filestring2), "/Players/%s.ini", name(playerid));
    if(!fexist(filestring2)) return SendClientMessage(playerid, -1 , ""RO"ERROR: Fail");
    new filestring[128];
    format(filestring, sizeof(filestring), "/Players/%s.ini", newname);
    if(fexist(filestring)) return SendClientMessage(playerid,  -1, ""RO"ERROR: Name is registered");
    frename(filestring2, filestring);
	SendClientMessageEx(-1, -1, ""AM"* %s changename: '%s'", nombre(playerid), newname);
	SetPlayerName(playerid, newname);
    return 1;
}
I wonder if it is correct and runs smoothly

sorry if I speak poor English

Thanks!
Reply
#6

Hmm impressive y_users.
i will work on it
Pipe98 i am again referring you towards my code again..
Reply
#7

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
Hmm impressive y_users.
i will work on it
Pipe98 i am again referring you towards my code again..
ok, thanks

testing code...
Reply
#8

Quote:
Originally Posted by gurmani11
Посмотреть сообщение
Hmm impressive y_users.
i will work on it
Pipe98 i am again referring you towards my code again..
Thank you! working properly
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)