24.01.2011, 17:37
I'm trying to load a name, looping all files which exists. I know how to do it, but since my files are numerated like: 0, 1, 2, 3, 4 ... Then I need to know which file of these one the name have been loaded.
So, how can I know what file the name have been loaded from?
pawn Code:
public OnPlayerConnect(playerid)
{
static str[128];
Loop(h, MAX_VEHICLES)
{
format(file,sizeof(file),local,h);
if(dini_Exists(file)) // I'm using dini in this cas
{
if(!strcmp(GetMyName(playerid), dini_Get(file,"Name"), true)) // Would search on all files
{
format(str,sizeof(str),""#red"[CAR SYSTEM]: "#green"Hello %s. You own a vehicle model %i. Your vehicle ID is: %i", // I didn't end here yet.
Player[playerid][Owner] = 1;
}
}
}
return 1;
}