SA-MP Forums Archive
Help +Rep - 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: Help +Rep (/showthread.php?tid=582336)



Help +Rep - Remy0 - 19.07.2015

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


Re: Help +Rep - Glenn332 - 19.07.2015

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]");
}




Re: Help +Rep - XBrianX - 20.07.2015

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.


Re: Help +Rep - Glenn332 - 20.07.2015

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.


Re: Help +Rep - XBrianX - 20.07.2015

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.


Re: Help +Rep - Glenn332 - 20.07.2015

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


Re: Help +Rep - rymax99 - 20.07.2015

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.


Re: Help +Rep - SickAttack - 20.07.2015

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");