Difference between revisions of "CSGO Vscript Examples"

From Valve Developer Community
Jump to: navigation, search
(Added external links.)
Line 13: Line 13:
 
*[[Logic_script|logic_script]]
 
*[[Logic_script|logic_script]]
 
*[[VScript|vscript]]
 
*[[VScript|vscript]]
 +
 +
==External links==
 +
* [http://en.wikipedia.org/wiki/Squirrel_(programming_language) Squirrel (programming language)] - Wikipedia Article on Squirrel
 +
* {{sq}}[http://squirrel-lang.org/ Squirrel: The Programming Language - Documentation and Sample Code]
 
[[Category:Counter-Strike:_Global_Offensive]]
 
[[Category:Counter-Strike:_Global_Offensive]]
 
[[Category:Scripting]]
 
[[Category:Scripting]]

Revision as of 21:11, 3 March 2016

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.

To do

See also

External links