nick change
#1

solved
Reply
#2

heeelp
Reply
#3

go the users.txt file and rename the name
Reply
#4

.... i want to make /nick command that name will can change ingame and save it...
Reply
#5

use DINI_fcopytextfile(oldname[], newname[]) and after that dini_Remove(oldname[])
Reply
#6

pawn Код:
dcmd_nick(playerid, params[])
{
        new vardas[MAX_PLAYER_NAME];
        GetPlayerName( playerid, vardas, 24 );
        frename(vardas[playerid],params[playerid]);
        SetPlayerName(playerid, params);
       
        new cFile[128], cName[MAX_PLAYER_NAME];
        GetPlayerName(playerid,cName,sizeof(cName));
       
       
        DINI_fcopytextfile(cName, params);
        dini_Remove(cName);        
        PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
        new string[128];
        format(string, sizeof(string),"changed to %s",params);
        return SendClientMessage(playerid,RED,string);
}
not working..
Reply
#7

Quote:
Originally Posted by jaksimaksi
Посмотреть сообщение
pawn Код:
//CODE
not working..
You know that you need to insert the oldfilename and the newfilename not the oldplayername and the newplayername
Reply
#8

how to get oldfilename?
Reply
#9

I think that is the correct file format (1. post)
pawn Код:
new name[MAX_PLAYER_NAME + 12];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
format(name, sizeof name, "/Users/%s.usr", name);
And name should contain the filename now
Reply
#10

whats wrong?

pawn Код:
dcmd_nick(playerid, params[])
{
        new name[MAX_PLAYER_NAME + 12];
        GetPlayerName(playerid, name, MAX_PLAYER_NAME);
        format(name, sizeof name, "/Users/%s.usr", name);
        DINI_fcopytextfile(name, params);
        dini_Remove(name);
        SetPlayerName(playerid, params);    
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)