How do i read something inside a file using Y_INi
#5

Wait, let me start from the beginning, I just got on the PC, so heres my defines and enums:

PHP код:
#define     CLAN_TAG_MEMBERS        "ClanMembers/%s.ini" 
PHP код:
enum PlayerData
{
    
ClanMember
}
new 
Player[MAX_PLAYERS][PlayerData]; 
PHP код:
public OnPlayerConnect(playerid)
{
     if(
fexist(Folder(playerid)))
    {
        
INI_ParseFile(Folder(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
    }
    else
    {
        new 
INI:file INI_Open(Folder(playerid));
        
INI_WriteInt(file"ClanMember"Player[playerid][ClanMember]);
        
INI_ParseFile(Folder(playerid), "LoadUser_%s", .bExtra true, .extra playerid);
        
INI_Close(file);
    }
    return 
1;

PHP код:
public OnPlayerSpawn(playerid)
{
    new 
playername[64];
    
GetPlayerName(playerid,playernameMAX_PLAYER_NAME);
    if(
strfind(playername,""SERVER_CLAN_TAG"",true) != 0)
    {
        if(
fexist(Folder(playerid)))
         {
             new 
INI:file INI_Open(Folder(playerid));
                    
// IDK WHAT TO DO HERE!
            
return 1;
        }
    }
    return 
1;

PHP код:
Folder(playerid)
{
    new 
string[128],playername[MAX_PLAYER_NAME];
     
GetPlayerName(playerid,playername,sizeof(playername));
      
format(string,sizeof(string),CLAN_TAG_MEMBERS,playername);
       return 
string;

Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)