Server doesnt update the text file automatically.
#1

Hi!
Well, I'm having problems with my faction system.
Basically, the command /foff is supposed to display everyone who is offline in the faction.
The command /ouninvite offline-uninvites the requested player.
However, whenever I uninvite a player from the faction the FOFF list doesnt get automatically updated.
It ONLY gets updated whenever the player logs in..
Thanks in advanced if you help!
Offline Uninvite CMD:

PHP Code:
COMMAND:ouninvite(playeridparams[])
{
    if(
PlayerInfo[playerid][ranklvl] != 0) return SendClientError(playeridCANT_USE_CMD);
    if(
PlayerInfo[playerid][playerteam] == CIV) return SendClientError(playeridCANT_USE_CMD);
    new 
iPlayerMAX_PLAYER_NAME ];
    if( 
sscanf params"s"iPlayer)) return SCP(playerid"[Exact_Name]");
    if(
GetPlayerId(iPlayer) != INVALID_PLAYER_ID) return SendClientError(playerid"That player is connected! Use /uninvite!");
    new 
fnameMAX_PLAYER_NAME 10 ];
    
format(fnamesizeof(fname), "%s.dudb.sav"iPlayer);
    if(!
dini_Exists(fname)) return SendClientError(playerid"Player not found in the database!");
    if(
strcmp(dini_Get(fname"teamname"), PlayerInfo[playerid][PTeamName], true)) return SendClientError(playerid"Player not in your faction!");
    
dini_Set(fname"teamname""Civilian");
    
dini_IntSet(fname"ranklvl", -1);
    
dini_IntSet(fname"playerteam"255);
    
dini_IntSet(fname"fpay"0);
    
dini_Set(fname"family""None");
    
format(iStrsizeof(iStr), "# [%s] %s has offline-uninvited %s."NoUnderscore(PlayerInfo[playerid][PTeamName]), RPName(playerid), iPlayer);
    
SendClientMessageToTeam(PlayerInfo[playerid][playerteam],iStr,COLOR_PLAYER_VLIGHTBLUE);
    
RemovePlayerFromFactionFile(aname);
    
format(iStrsizeof(iStr),"10[O-UNINVITE] %s has been offline-kicked from %s."iPlayer,PlayerInfo[playerid][PTeamName]);
    
iEcho(iStr);
    return 
1;

RemovePlayerFromFactionFile [STOCK] :

PHP Code:
stock RemovePlayerFromFactionFile(playername[])
{
    new 
FactionFileAndOkay[20];
    if(
dUserINT(playername).("playerteam") == 1)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("Corleone.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("Corleone.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("Corleone.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
     else if(
dUserINT(playername).("playerteam") == 2)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("Tattaglia.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("Tattaglia.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("Tattaglia.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
    else if(
dUserINT(playername).("playerteam") == 3)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("Stracci.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("Stracci.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("Stracci.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
    else if(
dUserINT(playername).("playerteam") == 4)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("Cuneo.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("Cuneo.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("Cuneo.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
     else if(
dUserINT(playername).("playerteam") == 5)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("Barzini.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("Barzini.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("Barzini.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
    else if(
dUserINT(playername).("playerteam") == 6)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("Paterno.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("Paterno.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("Paterno.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
    else if(
dUserINT(playername).("playerteam") == 7)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("LSPD.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("LSPD.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("LSPD.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
     else if(
dUserINT(playername).("playerteam") == 8)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("Hitman.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("Hitman.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("Hitman.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
    else if(
dUserINT(playername).("playerteam") == 9)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("SDC.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("SDC.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("SDC.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
    else if(
dUserINT(playername).("playerteam") == 10)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("SASF.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("SASF.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("SASF.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
    else if(
dUserINT(playername).("playerteam") == 11)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("Government.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("Government.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("Government.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
     else if(
dUserINT(playername).("playerteam") == 12)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("Leone.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("Leone.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("Leone.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
     else if(
dUserINT(playername).("playerteam") == 13)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("FBI.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("FBI.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("FBI.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
    else if(
dUserINT(playername).("playerteam") == 14)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("Kemirov.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("Kemirov.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("Kemirov.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
    else if(
dUserINT(playername).("playerteam") == 15)
    {
        for(new 
0150i++)
        {
            
format(FactionFileAndOkaysizeof(FactionFileAndOkay), "Member%d"i);
            if(
strcmp(dini_Get("DeMeo.ini"FactionFileAndOkay), playername) == 0)
            {
                
dini_Set("DeMeo.ini"FactionFileAndOkay"None");
            }
            if(
strcmp(dini_Get("DeMeo.ini"FactionFileAndOkay), "None") == 0) continue;
        }
    }
    return 
1;

FOFF Command:

PHP Code:
COMMAND:foff(playeridparams[])
{
    
GetPlayerName(playeridanamesizeof(aname));
    new 
Factionfacc[20], ListOfMembers[128];
    
Faction dUserINT(aname).("playerteam");
    if(
PlayerInfo[playerid][playerteam] == CIV || PlayerInfo[playerid][playerteam] == 0) return SendClientMessage(playeridCOLOR_ERROR"ERROR: You are not authorized to perform this command.");
    if(
Faction == 1)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline Corleone members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("Corleone.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("Corleone.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("Corleone.ini"facc)).("rankname"), dini_Get("Corleone.ini"facc), dUserINT(dini_Get("Corleone.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 2)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline Tattaglia members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("Tattaglia.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("Tattaglia.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("Tattaglia.ini"facc)).("rankname"), dini_Get("Tattaglia.ini"facc), dUserINT(dini_Get("Tattaglia.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 3)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline Stracci members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("Stracci.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("Stracci.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("Stracci.ini"facc)).("rankname"), dini_Get("Stracci.ini"facc), dUserINT(dini_Get("Stracci.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 4)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline Cuneo members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("Cuneo.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("Cuneo.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("Cuneo.ini"facc)).("rankname"), dini_Get("Cuneo.ini"facc), dUserINT(dini_Get("Cuneo.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 5)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline Barzini members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("Barzini.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("Barzini.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("Barzini.ini"facc)).("rankname"), dini_Get("Barzini.ini"facc), dUserINT(dini_Get("Barzini.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 6)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline Paterno members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("Paterno.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("Paterno.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("Paterno.ini"facc)).("rankname"), dini_Get("Paterno.ini"facc), dUserINT(dini_Get("Paterno.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 7)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline LSPD members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("LSPD.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("LSPD.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("LSPD.ini"facc)).("rankname"), dini_Get("LSPD.ini"facc), dUserINT(dini_Get("LSPD.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 8)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline Corleone members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("Hitman.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("Hitman.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("Hitman.ini"facc)).("rankname"), dini_Get("Hitman.ini"facc), dUserINT(dini_Get("Hitman.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 9)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline SDC members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("SDC.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("SDC.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("SDC.ini"facc)).("rankname"), dini_Get("SDC.ini"facc), dUserINT(dini_Get("SDC.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 10)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline SASF members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("SASF.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("SASF.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("SASF.ini"facc)).("rankname"), dini_Get("SASF.ini"facc), dUserINT(dini_Get("SASF.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 11)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline Government members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("Government.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("Government.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("Government.ini"facc)).("rankname"), dini_Get("Government.ini"facc), dUserINT(dini_Get("Government.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 12)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline Leone members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("Leone.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("Leone.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("Leone.ini"facc)).("rankname"), dini_Get("Leone.ini"facc), dUserINT(dini_Get("Leone.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 13)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline FBI members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("FBI.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("FBI.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("FBI.ini"facc)).("rankname"), dini_Get("FBI.ini"facc), dUserINT(dini_Get("FBI.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 14)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline Kemirov members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("Kemirov.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("Kemirov.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("Kemirov.ini"facc)).("rankname"), dini_Get("Kemirov.ini"facc), dUserINT(dini_Get("Kemirov.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    if(
Faction == 15)
    {
        
SendClientMessage(playeridCOLOR_HELPEROOC"Offline DeMeo members:");
        for(new 
0150i++)
        {
            
format(faccsizeof(facc), "Member%d"i);
            if(
strcmp(dini_Get("DeMeo.ini"facc), "None") == 0) continue;
            if(
NameToID(dini_Get("DeMeo.ini"facc)) != -1) continue;
            
format(ListOfMemberssizeof(ListOfMembers), "Rank & name: %s %s. Tier: %d."dUser(dini_Get("DeMeo.ini"facc)).("rankname"), dini_Get("DeMeo.ini"facc), dUserINT(dini_Get("DeMeo.ini"facc)).("ranklvl"));
            
SendClientMessage(playerid, -1ListOfMembers);
        }
    }
    return 
1;

Reply
#2

STOP these posts please, you're not funny.
Reply
#3

Please someone, help?
Reply
#4

<REMOVED>
Find the answer by your self.
Reply
#5

Quote:
Originally Posted by Norey
View Post
<REMOVED>
Find the answer by your self.
Obviously I tried. Anyone?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)