Random names
#1

pawn Код:
new RandomRPNames[][] =
{
    "Danny_Williams",
        //more here
    "Tyler_Mitchels",
};
and this is when a player connects with a not valid rp name

pawn Код:
if (!strlen(playernamesplit[0]) || !strlen(playernamesplit[1]))
            {
                new NameStr[MAX_PLAYER_NAME];
                format(NameStr, sizeof(NameStr), "NONRPNAME%d", playerid);
                SetPlayerName(playerid, NameStr);
                new rand = random(sizeof(RandomRPNames));
                format(string, sizeof(string), "{FFFFFF}Please select a new, valid roleplaying name\n{FFFFFF}Refrain from using tags and include 1 underscore.\n{FFFFFF}Example: {0086EF}%s", RandomRPNames[rand]);
                ShowPlayerDialog(playerid, 594, DIALOG_STYLE_INPUT, "ROLEPLAY NAME", string, "Change", "Quit");
            }
at the example it should show one of the names, but it doesnt.

how to fix that?
Reply
#2

Your message is 140 characters long. Too long to be formatted into the string and/or too long to be output to the chat.
Reply
#3

it shows the Example: so it should work, there is a problem in the random thing I think but I already tried evreything
Reply
#4

Try using two format sentences and sending it to the client twice..
Reply
#5

pawn Код:
if (!strlen(playernamesplit[0]) || !strlen(playernamesplit[1]))
            {
                new NameStr[MAX_PLAYER_NAME];
                format(NameStr, sizeof(NameStr), "NONRPNAME%d", playerid);
                SetPlayerName(playerid, NameStr);
                new rand = random(sizeof(RandomRPNames));
                format(string1, sizeof(string1), "%s", RandomRPNames[rand]);
                format(string, sizeof(string), "{FFFFFF}Please select a new, valid roleplaying name\n{FFFFFF}Refrain from using tags and include 1 underscore.\n{FFFFFF}Example: {0086EF}%s", string1);
                ShowPlayerDialog(playerid, 594, DIALOG_STYLE_INPUT, "ROLEPLAY NAME", string, "Change", "Quit");
            }
Still not...
Reply
#6

Quote:
Originally Posted by Vince
Посмотреть сообщение
Your message is 140 characters long. Too long to be formatted into the string and/or too long to be output to the chat.
Thanks solved +rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)