Dialog Save problem
#1

PHP код:
                    case 3// clan
                    
{
                        
ShowPlayerDialog(playerid65DIALOG_STYLE_INPUT"{17a005}Clan""{ffffff}Please enter the {17a005}clan {ffffff}in order to change it""Select""Cancel");
                        
myStrcpy(wat"Clan");
                        
//return 1;
                    
}
//===================================//
    
if(dialogid == 65)
    {
        if(!
response)
        {
            
SendClientMessage(playeridCOLOR_RED"You cancelled the dialog!");
        }
        else
        {
            if(
strlen(inputtext))
            {
                new 
iPlayer;
                
PlayerInfo[iPlayer][clan] = strval(inputtext);
                new 
string64 ];
                
format(stringsizeof(string), "INFO: Player Clan changed to {3BB9FF}%s.",strval(inputtext));
                
SendClientMessage(playerid, -1string);
            }
        }
        return 
1;
    } 
The dialog is not saving when i try. When i try to enter anything inside the dialog, its not saving at the PlayerInfo[playerid][clan] its just switching the word "None" to " ", which means its just removing the word, nothing else.
Reply
#2

As per the code, it expects you to enter a numerical inputtext. Whenever you type "None", strval will return 0. Also, you used the wrong format specifier while formatting string. It should be "%d" instead of "%s" since strval returns integer, not string.

I've to also add that I'm totally unclear about your code. What are you trying to do by declaring iPlayer? Your dialog responses will change the array data for zeroth index only.
Reply
#3

can you tell me what is the right "str" code to make it read string? and what exactly should I type?
Reply
#4

Quote:
Originally Posted by SytonicX
Посмотреть сообщение
can you tell me what is the right "str" code to make it read string? and what exactly should I type?
I'm not familiar with your clan data structure. Your code under OnDialogResponse won't work properly, unless you purposely intended it to be like that.
pawn Код:
format(string, sizeof(string), "INFO: Player Clan changed to {3BB9FF}%d.",strval(inputtext));
Replaced %s with %d
Reply
#5

Look, let me tell you how is it working, when I open a dialog and press on " Clan" this dialog is going to show up, when I type inside it for example: " Testing " or anything, its going to show up next to the word clan in the main dialog.
Reply
#6

Bumb, still need help with this.
Reply
#7

PHP код:
new iPlayer
PlayerInfo[iPlayer][clan] = strval(inputtext); 
What are you trying to do here?
I assume you are trying to assign this variable to playerid, if so you can do this;

PHP код:
PlayerInfo[playerid][clan] = strval(inputtext); 
Reply
#8

I am trying to give it to a target player not to myself.
Reply
#9

PHP код:
PlayerInfo[iPlayer][clan] = strval(inputtext); 
re-place this with this:
PHP код:
format(PlayerInfo[iPlayer][clan], 10inputtext); 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)