Adding to the Dialogs
#1

PHP код:
if(dialogid == DIALOG_INPUT)
    {
        if(
response)
        {
            if(
addRCON[playerid] == true)
            {
                new 
id[24];
                if(
strcmp(inputtextidfalse) == 0)
                {
                    
dfile_Open(PlayerPath(inputtext[id]));
                }
                return 
0;
            }
        }
    } 
-

PHP код:
stock PlayerPath(playerid)
{
    new 
path[128];
    
format(pathsizeof(path), ACC_PATH"%s.ini"NazwaGracza(playerid));
    return 
path;

-

PHP код:
stock NazwaGracza(playerid)//playername
{
    new 
nazwa[MAX_PLAYER_NAME];
    
GetPlayerName(playeridnazwasizeof(nazwa));
    return 
nazwa;

error 033: array must be indexed (variable "id")

lane 320:
dfile_Open(PlayerPath(inputtext[id]));

What the fu*k is wrong with this? :v
Reply
#2

id is an array, so you have to tell the programm which index of id it should access like id[0] (just an example),
otherwise if it is suppossed to be a string you cant use it as an index on another variable

actually i dont even get what u are trying ^^, do you want to filter an id ?

that code is pretty much bullshit xD
Reply
#3

PHP код:
new id[24];
dfile_Open(PlayerPath(id)); 
I do not understand how am I supposed to do
Reply
#4

I don't get it too. What are you trying to do?
Why don't you get the player's name in your 'Playerpath'? Like this :
PHP код:
#define PATH "/Players/%s.ini" // Put your folder.
stock UserPath(playerid)
{
    new 
string[128],playername[MAX_PLAYER_NAME];
    
GetPlayerName(playerid,playername,sizeof(playername)); // Get the player's name
    
format(string,sizeof(string),PATH,playername); // Replace %s of the PATH by the player's name
    
return string// Return the string (Ex: /Players/Dayrion.ini)

I don't think if this helped you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)