Need help with /changename command. - 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: Need help with /changename command. (
/showthread.php?tid=502982)
Need help with /changename command. -
HitterHitman - 27.03.2014
Hello friends I am using y_ini and this is how i saves player's stats on player disconnect:
pawn Code:
public OnPlayerDisconnect(playerid, reason)
{
new INI:File = INI_Open(UserPath(playerid));
INI_SetTag(File,"data");
INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
INI_WriteInt(File,"Vip",PlayerInfo[playerid][pVip]);
INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
INI_WriteInt(File,"Ban",PlayerInfo[playerid][pBan]);
INI_WriteInt(File,"Score",GetPlayerScore(playerid));
INI_WriteInt(File,"Talent",PlayerInfo[playerid][pTalent]);
INI_WriteInt(File,"Hitman",PlayerInfo[playerid][pHitman]);
INI_Close(File);
return 1;
}
Can some tell me how can I create a simple /changename command for players, which checks if the name is used or not. I will be very thankful. also this is userpath
pawn Code:
#define PATH "/Users/%s.ini"
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playername));
format(string,sizeof(string),PATH,playername);
return string;
}
Re: Need help with /changename command. -
HitterHitman - 27.03.2014
Nevermind I got it,
https://sampforum.blast.hk/showthread.php?tid=397180