Changing a players name
#1

I have a command that is used to set a players name based on YINI saving system :-

PHP код:
CMD:setname (playeridparams[])
            {
                new 
idname[25],str[120];
                if(
PInfo[playerid][Admin] < 7) return SendClientMessage(playeridRED,"[ERROR]: {FFFFFF}You do not have the privilleges to perform this command.");
                if(
sscanf(params"us[25]"idname)) return SendClientMessage(playeridTOMATO"[USAGE]: {FFFFFF}/setname [playerid/PartOfName] [name]");
                if(
strlen(name) < 3)return SendClientMessage(playeridCOLOR_RED"[ERROR]: {FFFFFF}The length of the name shouldn't be lower than 3!");
                if(
strlen(name) > MAX_PLAYER_NAME)return SendClientMessage(playeridCOLOR_RED"[ERROR]: {FFFFFF}The length of name exceeds the limit!");
                new 
file[64];
                
format(filesizeof(file), "/Users/%s.ini"name);
                if (
fexist(file)) return SendClientMessage(playeridCOLOR_RED"[ERROR]: {FFFFFF}That name is already registered in the database!");
                
fremove(UserPath(id));
                
SetPlayerName(id,name);
                
SaveStats(id);
                return 
1;
          } 
It works fine at first, i have tested relogging with it multiple times but when i turn off the server and then re start it, it shows a wrong password error according to my registration and login system. I would love any kind of help i can get about how it should be fixed.
Reply


Messages In This Thread
Changing a players name - by Uvais - 07.01.2018, 12:27
Re: Changing a players name - by jasperschellekens - 07.01.2018, 13:28
Re: Changing a players name - by Logic_ - 07.01.2018, 13:47
Re: Changing a players name - by jasperschellekens - 07.01.2018, 13:55
Re: Changing a players name - by Uvais - 07.01.2018, 14:13

Forum Jump:


Users browsing this thread: 1 Guest(s)