OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting Multiplayer => Topic started by: Baphomet on 05 Dec 2002, 10:05:20
-
I would imagine there is one that allows either to specify a playername. I am trying to write a script which will display the name of a person in a multiplayer game if he triggers something.
-
Are you looking for this one?:
name object
Operand types:
object: Object
Type of returned value:
String
Description:
Name of variable assigned to object in mission editor. In used on vehicle, name of first crew member (in order commander, driver, gunner).
Example:
name vehicle player
~S~ CD
-
Eg of trigger as seen in mission.sqm file
class Item43
{
position[]={7365.412109,118.396111,4775.931641};
a=300.000000;
b=300.000000;
activationBy="EAST";
repeating=1;
age="UNKNOWN";
text="EWarning";
name="EWarning";
expActiv="Titletext[format[""%1 \n You are entering a West Safezone \n Turn around or die!"",name(thisList select 0)],""Plain down""]";
class Effects
{
sound="Alarm";
titleEffect="PLAIN DOWN";
};
};
Place this in the triggers activation field
Titletext[format["%1 \n You are entering a West Safezone \n Turn around or die!",name(thisList select 0)],"Plain down"]
This is a trigger that displays a warning on screen, naming the East player that activated the outer area trigger of the protected West respawn zone
the \n is a switch that enters the following text on a new line
Hope this helps
-
or this works too.....for salute and name....(when using camera)
ap1 being the name of that character
;point the camera at the ap1 and display name
_cam camsettarget ap1
_cam camsetrelpos [0,2,1]
_cam camcommit 6
~6
Titletext ["" + (name ap1),"PLAIN DOWN"]
ap1 playmove "EffectStandSalute"
~5
-
well if u want ur script to work on every1 playing then use the %1 for their name...that is just basically saying that whoever trips the triggers activation will have their name displayed.