Call of Duty 4: Scripting Hints: Difference between revisions

From COD Modding & Mapping Wiki
Jump to navigation Jump to search
(New page: 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 mes...)
 
mNo edit summary
 
Line 1: Line 1:
[[Category:Call of Duty 4]]
[[Category:Modding]]
A few useful commands:
A few useful commands:


To print a large message on the screen:
*To print a large message on the screen:


'''iprintlnbold(stringMessage);'''
'''iprintlnbold(stringMessage);'''
Line 7: Line 9:
'''player iprintlnbold(stringMessage);'''
'''player iprintlnbold(stringMessage);'''


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


'''iprintln(stringMessage);
'''iprintln(stringMessage);
Line 13: Line 15:




To check whether a variable or entity exists:
*To check whether a variable or entity exists:


'''if(isdefined(timetowait))'''
'''if(isdefined(timetowait))'''
Line 19: Line 21:




You can also use functions in if statements, by the returned value:
*You can also use functions in if statements, by the returned value:
<pre>
<pre>
if(checksomething())
if(checksomething())

Latest revision as of 10:52, 24 October 2008

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;
}

--Novemberdobby 23:42, 23 October 2008 (UTC)