1) Added natives to create and manipulate global and private forward 2) Added natives to call forwards and functions 3) Added an IChanageableForward::RemoveFunction overload for convenience or something 4) Added test suite plugins for functions and forwards 5) Some random touch-ups to some include files --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40627
		
			
				
	
	
		
			44 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			SourcePawn
		
	
	
	
	
	
			
		
		
	
	
			44 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			SourcePawn
		
	
	
	
	
	
#include <sourcemod>
 | 
						|
 | 
						|
public Plugin:myinfo = 
 | 
						|
{
 | 
						|
	name = "Forward Testing Lab #2",
 | 
						|
	author = "AlliedModders LLC",
 | 
						|
	description = "Tests suite #2 for forwards created by plugins",
 | 
						|
	version = "1.0.0.0",
 | 
						|
	url = "http://www.sourcemod.net/"
 | 
						|
};
 | 
						|
 | 
						|
public Action:OnPrivateForward(num, const String:format[], ...)
 | 
						|
{
 | 
						|
	decl String:buffer[128];
 | 
						|
	
 | 
						|
	PrintToServer("Inside private forward #2");
 | 
						|
	
 | 
						|
	PrintToServer("num = %d (expected: %d)", num, 24);
 | 
						|
	
 | 
						|
	VFormat(buffer, sizeof(buffer), format, 3);
 | 
						|
	PrintToServer("buffer = \"%s\" (expected: \"%s\")", buffer, "I am a format string: 0 1 2 3 4 5");
 | 
						|
	
 | 
						|
	PrintToServer("End private forward #2");
 | 
						|
	
 | 
						|
	return Plugin_Handled;
 | 
						|
}
 | 
						|
 | 
						|
public OnGlobalForward(Function:a, b, Float:c, const String:d[], Float:e[3], &f, &Float:g)
 | 
						|
{
 | 
						|
	PrintToServer("Inside global forward \"OnGlobalForward\"");
 | 
						|
	
 | 
						|
	PrintToServer("a = %d (expected: %d)", a, 11);
 | 
						|
	PrintToServer("b = %d (expected: %d)", b, 7);
 | 
						|
	PrintToServer("c = %f (expected: %f)", c, -8.5);
 | 
						|
	PrintToServer("d = \"%s\" (expected: \"%s\")", d, "Anata wa doko desu ka?");
 | 
						|
	PrintToServer("e = %f %f %f (expected: %f %f %f)", e[0], e[1], e[2], 0.0, 1.1, 2.2);
 | 
						|
	
 | 
						|
	PrintToServer("f = %d (expected %d, setting to %d)", f, 99, 777);
 | 
						|
	f = 777;
 | 
						|
	
 | 
						|
	PrintToServer("g = %f (expected %f, setting to %f)", g, 4.215, -0.782);
 | 
						|
	g = -0.782;
 | 
						|
}
 |