Help +Rep
#1

i need a /changename CMD (ZCMD)

When A Player use it, a dialog appear to him "Change" , "Cancel"

when he Write a Name And Click Change , The Name of Him Changes , And -5000 from his money
Reply
#2

Haha this is not a request forum but ill help you out

PHP код:
CMD:changename(playeridparams[]) {
new 
string[36];
new 
money GetPlayerMoney(playerid);
if(!
sscanf(params"s[36]"string)) {
SetPlayerName(playeridstring);
GivePlayerMoney(playerid, -5000);
} else {
SendClientMessage(playerid0xFF0000FF"USAGE: /changename [new name]");
}

Reply
#3

Here is my code.

PHP код:
CMD:changename(playeridparams[])
{
            return 
1;
        }
        
//if(PlayerInfo[playerid][pBusiness1]) return SendClientMessage(playerid, COLOR_GREY, "You can't change name if you own business");
        
if(PlayerInfo[playerid][pFaction] == || PlayerInfo[playerid][pFaction] == 4)
        {
            
ShowPlayerDialogEx(playeridDIALOG_NAMECHANGEDIALOG_STYLE_INPUT"Name Change","Please enter your new desired name!\n\nNote: Name Changes are free for hitmen and FBI.""Change""Cancel");
        }
        else
        {
            
ShowPlayerDialogEx(playeridDIALOG_NAMECHANGEDIALOG_STYLE_INPUT"Name Change","Please enter your new desired name!\n\nNote: Name Changes cost $1500 per level.""Change""Cancel");
        }
    {
        
ShowPlayerDialogEx(playeridDIALOG_NAMECHANGEDIALOG_STYLE_INPUT"Name Change","Please enter your new desired name!\n\nNote: Name Changes free for hitmen, plus they may change it anywhere.""Change""Cancel");
        
    }
    return 
1;

Please REP+1 me i need them.
Reply
#4

Quote:
Originally Posted by XBrianX
Посмотреть сообщение
Here is my code.

PHP код:
CMD:changename(playeridparams[])
{
            return 
1;
        }
        
//if(PlayerInfo[playerid][pBusiness1]) return SendClientMessage(playerid, COLOR_GREY, "You can't change name if you own business");
        
if(PlayerInfo[playerid][pFaction] == || PlayerInfo[playerid][pFaction] == 4)
        {
            
ShowPlayerDialogEx(playeridDIALOG_NAMECHANGEDIALOG_STYLE_INPUT"Name Change","Please enter your new desired name!\n\nNote: Name Changes are free for hitmen and FBI.""Change""Cancel");
        }
        else
        {
            
ShowPlayerDialogEx(playeridDIALOG_NAMECHANGEDIALOG_STYLE_INPUT"Name Change","Please enter your new desired name!\n\nNote: Name Changes cost $1500 per level.""Change""Cancel");
        }
    {
        
ShowPlayerDialogEx(playeridDIALOG_NAMECHANGEDIALOG_STYLE_INPUT"Name Change","Please enter your new desired name!\n\nNote: Name Changes free for hitmen, plus they may change it anywhere.""Change""Cancel");
        
    }
    return 
1;

Please REP+1 me i need them.
Rofl this is just some ShowPlayerDialog's rofl this doesnt do anything if you dont give him the ondialogresponse.
Reply
#5

Quote:
Originally Posted by Glenn332
Посмотреть сообщение
Rofl this is just some ShowPlayerDialog's rofl this doesnt do anything if you dont give him the ondialogresponse.
Hey asshole.

This is just an example it is not the full code dipshit.
Reply
#6

Quote:
Originally Posted by XBrianX
Посмотреть сообщение
Hey asshole.

This is just an example it is not the full code dipshit.
Then why ask for rep for a piece of useless code you pulled from god knows where rofl
Reply
#7

At least attempt to make it - use the very many resources you can find on this forum. Also, a word to the wise, your rep isn't going to count, you don't have enough posts.
Reply
#8

Quote:
Originally Posted by XBrianX
Посмотреть сообщение
Hey asshole.

This is just an example it is not the full code dipshit.
Your code isn't even made good and it's a terrible example overall.

pawn Код:
return 1;
        }
Fail.

pawn Код:
{
        ShowPlayerDialogEx(playerid, DIALOG_NAMECHANGE, DIALOG_STYLE_INPUT, "Name Change","Please enter your new desired name!\n\nNote: Name Changes free for hitmen, plus they may change it anywhere.", "Change", "Cancel");
         
    }
Fail.

And calm yourself down, it won't do you any good insulting others.

pawn Код:
// [ DEVELOPMENT GAMEMODE ]

// INCLUDES:

#include <a_samp>
#include <zcmd>

// DEFINES:

// DIALOGS:

#define DIALOG_CHANGE_NAME 0

// MAIN:

main()
{
    print("Development Mode: change_name_dialog.amx");
}

// CALLBACKS:

public OnGameModeInit()
{
    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
{
    switch(dialogid)
    {
        case DIALOG_CHANGE_NAME:
        {
            if(!response) return 1;
            else if(response)
            {
                new name_length = strlen(inputtext);
                if(name_length < 3 || name_length > 20) return SendClientMessage(playerid, -1, "You have entered an invalid player name.");

                SetPlayerName(playerid, inputtext);
                GivePlayerMoney(playerid, -5000);
                return SendClientMessage(playerid, -1, "You have successfully changed your name.");
            }
        }
    }
    return 1;
}

// COMMANDS:

CMD:changename(playerid, params[])
{
    if(GetPlayerMoney(playerid) < 5000) return SendClientMessage(playerid, -1, "You do not have enough money to change your name.");
   
    ShowChangeNameDialog(playerid);
    return 1;
}

// FUNCTIONS:

stock ShowChangeNameDialog(playerid) return ShowPlayerDialog(playerid, DIALOG_CHANGE_NAME, DIALOG_STYLE_INPUT, "Change Name", "Enter your new name below.", "Submit", "Close");
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)