[HELP]Change Name.
#1

I have this command:

Код:
	if(strcmp(cmd, "/changename", true) == 0)
    {
      	if(IsPlayerConnected(playerid))
      {
        	tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "[USAGE]: /changename [id] [newname]");
                return 1;
            }
            giveplayerid = ReturnUser(tmp);
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
            if (PlayerInfo[playerid][pAdmin] >= 4)
            {
              if(IsPlayerConnected(giveplayerid))
              {
                if(giveplayerid != INVALID_PLAYER_ID)
                {
                        new length = strlen(cmdtext);
                        while ((idx < length) && (cmdtext[idx] <= ' '))
                        {
                            idx++;
                        }
                        new offset = idx;
                        new result[64];
                        while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
                        {
                            result[idx - offset] = cmdtext[idx];
                            idx++;
                        }
                        result[idx - offset] = EOS;
                        if(!strlen(result))
                        {
                            SendClientMessage(playerid, COLOR_GRAD2, "[USAGE]: /changename [id] [newname]");
                            return 1;
                        }
                        SetPlayerName(giveplayerid, (result));
                        return 1;
                    }
                }
            }
        }
        return 1;
    }
But is a problem, after relog, or server restart, the new name doesn't save in MySQL. How can i save the new name in MySQL DataBase?
Reply


Messages In This Thread
[HELP]Change Name. - by GaB1TzZzu - 09.01.2011, 09:57
Re: [HELP]Change Name. - by Ash. - 09.01.2011, 10:00
Re: [HELP]Change Name. - by GaB1TzZzu - 09.01.2011, 10:06
Re: [HELP]Change Name. - by GaB1TzZzu - 09.01.2011, 14:52
Re: [HELP]Change Name. - by GaB1TzZzu - 10.01.2011, 11:34
Re: [HELP]Change Name. - by GaB1TzZzu - 11.01.2011, 11:48
Re: [HELP]Change Name. - by Yvax - 11.01.2011, 11:53
Re: [HELP]Change Name. - by Rizard - 11.01.2011, 12:00
Re: [HELP]Change Name. - by _rAped - 11.01.2011, 12:02
Re: [HELP]Change Name. - by GaB1TzZzu - 11.01.2011, 12:10

Forum Jump:


Users browsing this thread: 2 Guest(s)