Dialog help
#1

If I put the code like this.
pawn Код:
if(dialogid == 1)
        {
            if(response)
            {
                new namestring[50];
                namestring = strval(inputtext); // Error Line
                format(string, sizeof(string), "LARP/Users/%s.ini", namestring);
                if(!dini_Exists(string))
                {
                    SetPlayerName(playerid, namestring);
                    format(string, sizeof(string),"You choosed %s as your undercover name. (( To get your normal name back simply type /offduty ))",namestring);
                    SendClientMessage(playerid,COLOR_RLRPGBLUE,string);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "You can't take a name that is allready in use.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RLRPGBLUE, "It would be safer with an undercover name. But ok, you decide.");
                return 1;
            }
        }
I get this error
Код:
error 033: array must be indexed (variable "namestring")
But if I put the code like this.
pawn Код:
if(dialogid == 1)
        {
            if(response)
            {
                new namestring[50] = strval(inputtext);//Error Line
                format(string, sizeof(string), "LARP/Users/%s.ini", namestring);
                if(!dini_Exists(string))
                {
                    SetPlayerName(playerid, namestring);
                    format(string, sizeof(string),"You choosed %s as your undercover name. (( To get your normal name back simply type /offduty ))",namestring);
                    SendClientMessage(playerid,COLOR_RLRPGBLUE,string);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_GREY, "You can't take a name that is allready in use.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_RLRPGBLUE, "It would be safer with an undercover name. But ok, you decide.");
                return 1;
            }
        }
I get this error..
Код:
must be a constant expression; assumed zero
How do I fix it?
Reply


Messages In This Thread
Dialog help - by Don_Cage - 03.09.2013, 12:53
Re: Dialog help - by Konstantinos - 03.09.2013, 13:01
Re: Dialog help - by Don_Cage - 03.09.2013, 15:48

Forum Jump:


Users browsing this thread: 1 Guest(s)