Es exists
From EventScripts Community Encyclopedia
|
[edit] OverviewSyntax: Note: Command parameters are described inside the
< and > characters. Optional parameters are contained within [ and ] characters.Variation of this command that doesn't expand variables: es_xexists [edit] DescriptionChecks for the existence of item specified by type and stores the result in variable. 0 means it does not exist and 1 means it does exists. [edit] Parameters
[edit] Exampleses_xset somevar 0 es_xset myvar 0 es_xexists myvar variable somevar //results 1 for true. if (server_var(myvar) == 1) do { // do some code if results are true. } es_xelse do { // do some code if results are false. } For use with key exists: es_xset key_exist 0 es_exists key_exist key Sounds event_var(userid) // checks if a key named with their userid exists if (server_var(key_exist) = 0) do { //do code if key doesn't exist i.e. create the key } else do { //do code if key exists. } For use with userids: es_xset userid_exists 0 es_xexists userid_exists userid 34 if (server_var(userid_exists) == 1) then kickid 34 For use with maps: es_xset map_exists 0 es_xexists map_exists map cs_italy if (server_var(map_exists) == 1) then changelevel cs_italy
[edit] Notes
[edit] See also
|
