PDA

View Full Version : Adding to the Dialogs


Jaev
05/05/2016, 06:07 PM
if(dialogid == DIALOG_INPUT)
{
if(response)
{
if(addRCON[playerid] == true)
{
new id[24];
if(strcmp(inputtext, id, false) == 0)
{
dfile_Open(PlayerPath(inputtext[id]));
}
return 0;
}
}
}

-

stock PlayerPath(playerid)
{
new path[128];
format(path, sizeof(path), ACC_PATH"%s.ini", NazwaGracza(playerid));
return path;
}

-

stock NazwaGracza(playerid)//playername
{
new nazwa[MAX_PLAYER_NAME];
GetPlayerName(playerid, nazwa, sizeof(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

BiosMarcel
05/05/2016, 06:17 PM
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

Jaev
05/05/2016, 06:26 PM
new id[24];
dfile_Open(PlayerPath(id));

I do not understand how am I supposed to do

Dayrion
05/05/2016, 06:59 PM
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 :

#define PATH "/Players/%s.ini" // Put your folder.
stock UserPath(playerid)
{
new string[128],playername[MAX_PLAYER_NAME];
GetPlayerName(playerid,playername,sizeof(playernam e)); // 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.