Scripting hints

From COD Modding & Mapping Wiki
Revision as of 02:41, 24 October 2008 by Novemberdobby (talk | contribs) (New page: == Scripting hints == A few useful commands: To print a large message on the screen: '''iprintlnbold(stringMessage);''' or to a specific player: '''player iprintlnbold(stringMessage...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Scripting hints

A few useful commands:

To print a large message on the screen:

iprintlnbold(stringMessage); or to a specific player: player iprintlnbold(stringMessage);

To print a small message on the bottom left of the screen:

iprintln(stringMessage); same as iprintlnbold() to a specific player


To check whether a variable or entity exists:

if(isdefined(timetowait))

 wait (timetowait);


You can also use functions in if statements, by the returned value:

if(checksomething())
  //code here

checksomething()
{
  if(var == "hi there!") //remember to use == in if statements to check equality, but var1 = var2 to set equality outside them.
    return true;
  else
    return false;
}