SA-MP Forums Archive
Random names - 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: Random names (/showthread.php?tid=397890)



Random names - Stefand - 07.12.2012

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?


Re: Random names - Vince - 07.12.2012

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


Re: Random names - Stefand - 07.12.2012

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


Re: Random names - RajatPawar - 07.12.2012

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


Re: Random names - Stefand - 07.12.2012

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...


Re: Random names - Stefand - 08.12.2012

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