Scripting/Squirrel/Functions/FindCheckpoint: Difference between revisions
		
		
		
		Jump to navigation
		Jump to search
		

This wiki is using an old backup from 2020
Some information may be old/missing
|  (Created page with "== Syntax ==  <pre>FindCheckPoint(ID)</pre>  == Arguments ==  *''int'' '''ID''' - The ID of the Checkpoint to find  == Example ==  <source lang=squirrel> function onPlayerComm...") | No edit summary | ||
| Line 1: | Line 1: | ||
| == Syntax == | == Syntax == | ||
| <pre> | <pre>FindCheckpoint(ID)</pre> | ||
| == Arguments == | == Arguments == | ||
| Line 14: | Line 14: | ||
| 	if(cmd == "findcp") | 	if(cmd == "findcp") | ||
| 	{ | 	{ | ||
| 		local cp =  | 		local cp = FindCheckpoint(text.tointeger()); | ||
| 		if (cp) | 		if (cp) | ||
| 		{ | 		{ | ||
| 			MessagePlayer("[#00FF00]Checkpoint has been found!", player); | |||
| 			MessagePlayer("[#00FF00] | 		}   | ||
| 		} else { | 		else   | ||
| 			MessagePlayer("[#FF0000] | 		{ | ||
| 			MessagePlayer("[#FF0000]Checkpoint has not been found", player); | |||
| 		} | 		} | ||
| 	} | 	} | ||
| 	return 1; | |||
| } | } | ||
| </source> | </source> | ||
| === Notes === | === Notes === | ||
| Call [[onPlayerCommand]] was used in this example. More info about it in the page. | Call [[onPlayerCommand]] was used in this example. More info about it in the page. | ||
Revision as of 20:00, 23 April 2016
Syntax
FindCheckpoint(ID)
Arguments
- int ID - The ID of the Checkpoint to find
Example
function onPlayerCommand( player, cmd, text )
{
	if(cmd == "findcp")
	{
		local cp = FindCheckpoint(text.tointeger());
		if (cp)
		{
			MessagePlayer("[#00FF00]Checkpoint has been found!", player);
		} 
		else 
		{
			MessagePlayer("[#FF0000]Checkpoint has not been found", player);
		}
	}
	return 1;
}Notes
Call onPlayerCommand was used in this example. More info about it in the page.