SA-MP Forums Archive
nick change - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: nick change (/showthread.php?tid=219964)



solved - jaksimaksi - 02.02.2011

solved


Re: nick change - jaksimaksi - 03.02.2011

heeelp


Re: nick change - Steven Paul - 03.02.2011

go the users.txt file and rename the name


Re: nick change - jaksimaksi - 03.02.2011

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


AW: nick change - Nero_3D - 03.02.2011

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


Re: nick change - jaksimaksi - 03.02.2011

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..


AW: Re: nick change - Nero_3D - 03.02.2011

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


Re: nick change - jaksimaksi - 03.02.2011

how to get oldfilename?


AW: nick change - Nero_3D - 03.02.2011

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


Re: nick change - jaksimaksi - 03.02.2011

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);    
}