CS:GO VScript Examples: Difference between revisions
		
		
		
		
		
		Jump to navigation
		Jump to search
		
				
		
		
	
|  (Created page) | No edit summary | ||
| Line 1: | Line 1: | ||
| {{csgo}} The following are example [[VScript|vscripts]] for [[Counter-Strike: Global Offensive]]. | |||
| ===Find the closest player to a known entity=== | |||
| <source lang=cpp>buttonReference <- Entities.FindByName( null, "button_01" ); // find the in-game entity "button_01" and store its targetname | |||
| 		player <- Entities.FindByClassnameNearest( "player", buttonReference.GetOrigin(), 512 ); // find the nearest player within 512 hammer units to the button's origin and create a variable. | |||
| </source> | |||
| ===Next Example=== | |||
| {{todo}} | {{todo}} | ||
Revision as of 20:52, 3 March 2016
 The following are example vscripts for Counter-Strike: Global Offensive.
 The following are example vscripts for Counter-Strike: Global Offensive.
Find the closest player to a known entity
buttonReference <- Entities.FindByName( null, "button_01" ); // find the in-game entity "button_01" and store its targetname
		player <- Entities.FindByClassnameNearest( "player", buttonReference.GetOrigin(), 512 ); // find the nearest player within 512 hammer units to the button's origin and create a variable.
Next Example
[Todo]