AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   TrieDeleteKey && ArrayDeleteItem (https://forums.alliedmods.net/showthread.php?t=173396)

OvidiuS 12-04-2011 12:10

TrieDeleteKey && ArrayDeleteItem
 
Does this 2 function update array and trie data?
I'm having problem with this two function, trie/array isn't updated.
I used Advanced bans, as start point.
Code:

RemoveMark(Position, const TargetID[])
{
        TrieDeleteKey(g_tSteamIDs, TargetID);
        ArrayDeleteItem(g_DataArray, Position);
       
        g_total_comments--;
       
        new iFile = fopen(g_CommentFile, "wt");
       
        new Data[SpecData];

        for( new i = 0; i < g_total_comments; i++ )
        {
                ArrayGetArray(g_DataArray, i, Data);
                TrieSetCell(g_tSteamIDs, Data[Data_SteamID], i);
               
                fprintf(iFile, "^"%s^" ^"%s^"^n", Data[Data_SteamID], Data[Data_Comment]);
        }
        fclose(iFile);
}


fysiks 12-04-2011 12:31

Re: TrieDeleteKey && ArrayDeleteItem
 
What do you mean by "isn't updated"? You delete the trie key but then immediately reset the try key.

OvidiuS 12-04-2011 12:49

Re: TrieDeleteKey && ArrayDeleteItem
 
I delete triekey, and array data for that key.
Then i get array data, and write it again in file, i also update the trie with data from array.

But problem is, that i print hud message with data, for specific id.
After i delete the key, and array data for that id, i still see the message.

fysiks 12-04-2011 20:31

Re: TrieDeleteKey && ArrayDeleteItem
 
I don't see anything in your code about HUD messages.


All times are GMT -4. The time now is 11:55.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.