Home   Help Search Login Register  

Author Topic: what this do?  (Read 893 times)

0 Members and 3 Guests are viewing this topic.

marcus3

  • Guest
what this do?
« on: 17 Mar 2005, 16:04:49 »
i know what these do but can you explane how they do it ( i think it might helpme understand some things)
this setpos [(getpos this select 0), (getpos this select 1), 5.8]
and
man sidechat format [""I have %1$ in my pocket"",manmoney]

thanks

Offline ACF

  • Members
  • *
  • Llama?? Ain't that French for tanks?
Re:what this do?
« Reply #1 on: 17 Mar 2005, 17:26:14 »
this setpos [(getpos this select 0), (getpos this select 1), 5.8]
'this' refers to the unit.
GetPos this returns the grid position array of 'this' unit: [x,y,z]
GetPos this Select 0 is the first element of the position array: x
GetPos this Select 1 is the second element of the position array: y
this SetPos [e,n,h] instantly moves 'this' unit to that grid position
So:
this setpos [(getpos this select 0), (getpos this select 1), 5.8]
moves this unit to its original x and y coordinates but 5.8m above ground level


Quote
man sidechat format [""I have %1$ in my pocket"",manmoney]
Format ["this is a string I want to put a %1 in",variable]
converts a variable to a string (e.g. a value of 8 to "8") and displays it on its own or in a string containing the place holder %1.
man Sidechat "Roger" displays a text radio message "Roger" to all units on man's side
So:
man sidechat format [""I have %1$ in my pocket"",manmoney]
Displays "I have 27$ in my pocket" as radio text when the value of manmoney is 27

marcus3

  • Guest
Re:what this do?
« Reply #2 on: 17 Mar 2005, 17:44:22 »
ok thanks man this will help alot.
;)