Dini Script file -
Slappybay - 23.03.2012
Hello, i am trying to script this command that it searches through all my dini saved file in Scriptfiles/Accounts and what i want it to do is Return the name if a player has a certain variable saved i have tried many codes but it returned the other value i placed. This is what i have
Код:
format(string, sizeof(string), "scriptfiles/Accounts/%s",MAX_ACCOUNTS);
if(fexist(string))
{
if(dini_Get(string, "Wanted") >= 1))
{
format(string2,sizeof(string2),"%s's is wanted",MAX_ACCOUNTS); /// I Know somethings wrong here....
SendClientMessage(playerid,WHITE,string2);
}
else
{
SendClientMessage(playerid,WHITE,"No matches found");
}
}
Re: Dini Script file -
new121 - 23.03.2012
Can you provide a little more of the code?
Re: Dini Script file -
Steven82 - 23.03.2012
Quote:
Originally Posted by AlExAlExAlEx
|
Wow if only it was that simple for a new comer to change to a totally new and complex looking .ini system.
Think before posting crap like this.
Re: Dini Script file -
Jonny5 - 23.03.2012
i dont think they meant that in a rude way, there are many good reasons to update to yini, and its not that complex considering.....
look at your post count and JOIN DATE at SAMP, this would clearly make you not a new comer.
But moving to yini does not solve your problem
so lets skip all that and get on to fixing them
what is MAX_ACCOUNTS? we have no way to see this value.
and are you getting any errors when trying to compile? if so what are they?
I don't see any loop so i'm not sure whats going on here, some more code would help.
Re: Dini Script file -
Slappybay - 24.03.2012
#define MAX_ACCOUNTS 1000
This is my max accounts.. i mean it works for my businesses and other Files but for some reason not for my accounts. but i do have a enum for my businesses and other files but..... That would have any thing to do with it
Re: Dini Script file -
Jonny5 - 24.03.2012
okay so that translated into your code would be this
pawn Код:
if(fexist("scriptfiles/Accounts/"))
which is not a file.
reason 1 is "scriptfiles/Accounts/%s" is looking for a string and your MAX_ACCOUNTS = 1000
which is a number so if you did
pawn Код:
"scriptfiles/Accounts/%i"
then your code would still not work but this is what it would actually output
pawn Код:
if(fexist("scriptfiles/Accounts/1000"))
i know this dont fix this but without seeing more code from you..
i hope this clears up whats wrong with your code.
Re: Dini Script file -
Slappybay - 24.03.2012
Thank you for your support... but long story short all im trying to do is look though all the account files and if one player variable is equal to the one imputed it would return the name.
Re: Dini Script file -
chrism11 - 24.03.2012
nvm need more coded***
Re: Dini Script file -
Jonny5 - 24.03.2012
Quote:
Originally Posted by Slappybay
Thank you for your support... but long story short all im trying to do is look though all the account files and if one player variable is equal to the one imputed it would return the name.
|
without a list of the player names it wont be easy,
im not sure if there are functions that support getting the names of all files in a folder
but if there are thats where you need to start,
then have it loop threw each file,
but first you need code to find all files in a directory.
edit:
only way i see todo it is with players files that are online only.