Taking over on someone's work
#32

Quote:
Originally Posted by JaKe Elite
Посмотреть сообщение
Server has expired, A new IP has been setted up, please refrain to the signature below if you wanted to join.

5 days to go for LAdmin's re-release.
I have a question, Currently I have a command that lets you change the name of the player's account, how it would be being implemented in SQLite & SSCANF?

My code:


PHP код:
CMD:changename(playerid,params[])
{
if(
PlayerInfo[playerid][Admin] >= && PlayerInfo[playerid][Admin] <= 91) return SendClientMessage(playeridRed"ERROR: Disable command for low level admins!"),SendClientMessage(playeridRed"* If you want change your name, you say with owner of server.");
    if(
PlayerInfo[playerid][LoggedIn] == 1)
     {
        if(
GetPlayerScore(playerid)>19)
        {
            if(
NoName[playerid] == 1)
            {
                if(
isnull(params))
                return 
SendClientMessage(playeridRed"* Usage: /changename [new name]");
                if (
strlen(params) < || strlen(params) > 20)
                return 
SendClientMessage(playerid,Red,"ERROR: The name must be between 3 and 20 characters");
                if(!
IsValidName(params))
                return 
SendClientMessage(playeridRed"* The name have invalid characters.");
                new 
name[MAX_PLAYER_NAME], string[128], sname[150];
                if(
udb_Exists(params))
                return 
SendClientMessage(playeridRed"This name already exists, choose another");
                
GetPlayerName(playeridnamesizeof(name));
                
format(string,sizeof(string),"* %s (ID: %d) was changed the name to: \"%s\" .",name,playerid,params);
                
SendClientMessageToAll(0xFFFF00FF,string);
                
format(sname,sizeof(sname),"* %s (ID: %d) was changed the name to: \"%s\" .",name,playerid,params);
                
                new 
year,month,day;    getdate(yearmonthday);
                 new 
hour,minute,secondgettime(hour,minute,second);
                new 
wea[500];
                
format(wea,sizeof(wea),"{FFFFFF}        Hi %s!, You changed your nick!\
                \n\n{FFFFFF}Your old nick is: %s\
                   \n{FFFFFF}Your new nick is: %s\
                \n{FFFFFF}Date: %i/%i/%i Time: %i:%i :%i\
                \n\n{FFFFFF}Remember that when you leave the server and then re-enter\
                \n{FFFFFF}you must put your new nick %s in your SA-MP to re-enter your new nick\
                \n\n{FFFFFF}We recommend you take a picture by pressing F8 so do not waste your nick."
,name,name,params,day,month,yearhourminutesecond,params);
                
ShowPlayerDialog(playerid8000DIALOG_STYLE_MSGBOX"You've changed your nickname!"wea"OK""");
                    
                
NoName[playerid] = 0;
                
udb_RenameUser(nameparams);
                
SetPlayerName(playeridparams);
            }
        else return 
SendClientMessage(playerid,Red,"* You can only use this command once.");
        }
    else return 
SendClientMessage(playerid,Red,"* You need 20 score for change your name.");
    }
    else return 
SendClientMessage(playerid,Red,"* You need to log (/login) To use this command");
    return 
1;

Or is it possible that you can create a similar command in the new LAdmin to change the name of the player's account? Please.
Reply


Messages In This Thread
Taking over on someone's work - by JaKe Elite - 29.08.2016, 10:56
Re: Taking over on someone's work - by Sew_Sumi - 29.08.2016, 11:16
Re: Taking over on someone's work - by AndySedeyn - 29.08.2016, 11:20
Re: Taking over on someone's work - by JaKe Elite - 29.08.2016, 11:23
Re: Taking over on someone's work - by markparker12 - 29.08.2016, 11:25
Re: Taking over on someone's work - by JaKe Elite - 29.08.2016, 11:37
Re: Taking over on someone's work - by Sew_Sumi - 29.08.2016, 11:54
Re: Taking over on someone's work - by Crayder - 29.08.2016, 12:43
Re: Taking over on someone's work - by HeLiOn_PrImE - 29.08.2016, 19:59
Re: Taking over on someone's work - by Sew_Sumi - 29.08.2016, 20:08
Re: Taking over on someone's work - by Vince - 29.08.2016, 20:37
Re: Taking over on someone's work - by Hiddos - 29.08.2016, 20:37
Re: Taking over on someone's work - by Crayder - 29.08.2016, 20:40
Re: Taking over on someone's work - by PrO.GameR - 30.08.2016, 08:13
Re: Taking over on someone's work - by JaKe Elite - 30.08.2016, 08:44
Re: Taking over on someone's work - by Brainles5 - 30.08.2016, 14:17
Re: Taking over on someone's work - by JaydenJason - 30.08.2016, 14:28
Re: Taking over on someone's work - by Sew_Sumi - 30.08.2016, 14:52
Re: Taking over on someone's work - by AndySedeyn - 30.08.2016, 14:57
Re: Taking over on someone's work - by Sew_Sumi - 30.08.2016, 15:10
Re: Taking over on someone's work - by StreetGT - 30.08.2016, 17:04
Re: Taking over on someone's work - by AndySedeyn - 30.08.2016, 17:13
Re: Taking over on someone's work - by JuannJohnson - 30.08.2016, 22:13
Respuesta: Taking over on someone's work - by Revelation - 01.09.2016, 01:50
Re: Taking over on someone's work - by JaKe Elite - 01.09.2016, 10:52
Re: Taking over on someone's work - by AndySedeyn - 01.09.2016, 11:02
Re: Taking over on someone's work - by markparker12 - 01.09.2016, 16:16
Re: Taking over on someone's work - by JaKe Elite - 02.09.2016, 11:11
Re: Taking over on someone's work - by JaKe Elite - 02.09.2016, 14:01
Re: Taking over on someone's work - by JaKe Elite - 03.09.2016, 11:46
Re: Taking over on someone's work - by markparker12 - 03.09.2016, 14:01
Respuesta: Re: Taking over on someone's work - by Revelation - 04.09.2016, 07:15
Re: Taking over on someone's work - by JaKe Elite - 04.09.2016, 08:13
Re: Taking over on someone's work - by Logic_ - 04.09.2016, 10:21
Re: Taking over on someone's work - by JaKe Elite - 08.09.2016, 06:01
Re: Taking over on someone's work - by Crayder - 11.09.2016, 02:52
Re: Taking over on someone's work - by Threshold - 15.09.2016, 06:05

Forum Jump:


Users browsing this thread: 6 Guest(s)