Raised This Month: $ Target: $400
 0% 

[TF2|API] Training Messsages


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mr_panica
Senior Member
Join Date: Jan 2017
Location: Russia, Saint-Petersburg
Old 03-05-2021 , 16:21   Re: [TF2|API] Training Messsages
Reply With Quote #21

Quote:
Originally Posted by arthurdead View Post
did you call RemoveTrainingMessageFrom* properly

can you show your code via DM or here
I'm not very good at coding.
Here are the functions that I am using.
HTML Code:
public void SendHintToClient(int client, float time, char[] title, char[] message)
{	
	if (!IsClientSourceTV(client) || !IsClientReplay(client))
	{
		if(IsPlayerAlive(client))
		{
			PrintToServer("SendHintToClient (%N)", client);
			KillHintTimer(client);
			SendTrainingMessageToClient(client, title, message);
			Timer_Hint[client] = CreateTimer(time, TIMER_END_HINT, client);
		}
	}
}

public Action TIMER_END_HINT(Handle hTimer, int client)
{
	KillHintTimer(client);
	DeleteTrainingMessageFromClient(client);

	return Plugin_Continue;
}

public void DeleteTrainingMessageFromClient(int client)
{
	if(!IsClientReplay(client) && !IsClientSourceTV(client) && IsClientConnected(client) && IsTrainingMessageVisibleToClient(client))
		RemoveTrainingMessageFromClient(client);
}


public void KillHintTimer(int client)
{
	if(Timer_Hint[client] != INVALID_HANDLE)
	{
		KillTimer(Timer_Hint[client]);
		Timer_Hint[client] = INVALID_HANDLE;
	}
}
__________________
Sorry for my English.
Mr_panica is offline
 



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 23:37.


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