Raised This Month: $ Target: $400
 0% 

[TF2|API] Training Messsages


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
arthurdead
Senior Member
Join Date: Jul 2013
Old 03-05-2021 , 17:30   Re: [TF2|API] Training Messsages
Reply With Quote #22

Quote:
Originally Posted by Mr_panica View Post
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;
	}
}
made a new commit: https://github.com/arthurdead/sm-plu...41a278e91b9f3b

try it out and see how it goes

btw you dont need the IsTrainingMessageVisibleToClient check
arthurdead is offline
 


Thread Tools
Display Modes

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