Raised This Month: $ Target: $400
 0% 

TrieDeleteKey && ArrayDeleteItem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 12-04-2011 , 12:10   TrieDeleteKey && ArrayDeleteItem
Reply With Quote #1

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);
}
OvidiuS is offline
Send a message via Skype™ to OvidiuS
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-04-2011 , 12:31   Re: TrieDeleteKey && ArrayDeleteItem
Reply With Quote #2

What do you mean by "isn't updated"? You delete the trie key but then immediately reset the try key.
__________________

Last edited by fysiks; 12-04-2011 at 12:33.
fysiks is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 12-04-2011 , 12:49   Re: TrieDeleteKey && ArrayDeleteItem
Reply With Quote #3

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.

Last edited by OvidiuS; 12-04-2011 at 13:08. Reason: must talk with exolent
OvidiuS is offline
Send a message via Skype™ to OvidiuS
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 12-04-2011 , 20:31   Re: TrieDeleteKey && ArrayDeleteItem
Reply With Quote #4

I don't see anything in your code about HUD messages.
__________________
fysiks is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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