Anyone has a clue why my inputtext isn't working properly? It occassionally adds/switches random characters.
EDIT: I should note that I use y_inline for all of my dialogs and they all work properly, except for this one.
PHP код:
if ( playertextid == creation_nameSel [ playerid ] ) {
inline creation_NameSel(pid, dialogid, response, listitem, string:inputtext[]) {
#pragma unused pid, dialogid, listitem
if ( ! response ) {
// No choice
}
if ( response ) {
if ( ! IsRPName ( inputtext )) {
return Dialog_ShowCallback ( playerid, using inline creation_NameSel, DIALOG_STYLE_INPUT, "Character: Name Selection", "Enter your character's name.\n\n\
Your name isn't a valid roleplaying name!\nIt has to be in a Firstname_Lastname format.\nIt can't be smaller than 5, or longer than 24 characters.", "Continue", "Cancel" );
}
new nameString [ 64 ] ;
player_nameSelect [ playerid ] [ 0 ] = EOS ;
strcat(nameString, inputtext, MAX_PLAYER_NAME ) ;
strcat ( player_nameSelect [ playerid ], inputtext, MAX_PLAYER_NAME ) ;
if ( strlen ( inputtext ) > 10 ) {
strdel(nameString, 10, sizeof ( nameString ) ) ;
strins(nameString, "...", 10, sizeof ( nameString ) ) ;
}
format ( nameString, sizeof ( nameString ), "Name~w~ %s", nameString ) ;
PlayerTextDrawSetString(playerid, creation_nameSel [ playerid ], nameString ) ;
}
}
return Dialog_ShowCallback ( playerid, using inline creation_NameSel, DIALOG_STYLE_INPUT, "Character: Name Selection", "Enter your character's name.", "Continue", "Cancel" );
}