$DetectHitObject = ""; #To get objectstrings for detection look at docs/ObjectHit.txt
$MaxCarResets = 0;
privmsg("Your Text here"); # Send text to player
globalMsg("Text Here");#Send text to all players
Event OnCarContact($PlayerA,$PlayerB,$PlayerA_Speed,$PlayerB_Speed,$PlayerA_X,$PlayerB_X,$PlayerA_Y,$PlayerB_Y) # Player event
EndEvent
All_Concrete
All_Railings
Banners
SpeedBumps
GetCurrentPlayerVar("ObjectContactX") //X position of player
GetCurrentPlayerVar("ObjectContactY") //Y position of player
Event OnObjectCollision($userName,$ObjectFlag,$ObjectHitTime,$Object_X,$Object_Y,$Object_Z,$TypeObject) # Player event
EndEvent
-New InsimPacket:OBH ObjectHit (Collision detection between car and object)
[b]-New Events :[/b]
OnObjectCollision (Object hit detection)
OnAcceleration2( Second Acceleration progress)
[b]-New PlayerVars :[/b]
ObjectContactX, //X position of player (dont know if this is usefull X does the same
ObjectContactY, //Y position of player (dont know if this is usefull Y does the same)
ObjectContactSpeed, //Speed of player when hitting a object
ObjectContactHead, //Heading of player when hitting a object
ObjectContactDir, //Direction of player when hitting a object
AccelerationStartSpeed2, // Min value for the acceleration feature relative to user unit km or mph
AccelerationEndSpeed2, // Max value for the acceleration feature relative to user unit km or mph
AccelerationTime2, // Acceleration time achieved from start to end speed
$DetectHitObject = "All_Objects";
"" = No Object detection
All_Objects //All Objects
All_Tires //Small+Big Tires
All_Cones //All Type of Cones incl Pointers
All_Markers //All Types of Markers
All_DistMarkers //Distance Markers
All_Post//All Posts (Green/Orange/Red/White)
Green_Post
Orange_Post
Red_Post
White_Post
All_Barriers // All Types of Barriers
Long_Barrier
Red_Barrier
White_Barrier
Bale
KeepSigns
SpeedSigns
$IgnoreObjects = Small_Tires&Big_Tires
All // All objects will be ignored
Small_Tires // All small tires will be ignored
Big_Tires //All big tires will be ignored
Cones//All Cones(normal+pointers) will be ignored
objectHit = Objects(obh.Index);
private string Objects(int ObjectIndex)
{
string[] Object = new string[192];
Object[0] = "Scenery object";
Object[1] = "";
Object[2] = "";
Object[3] = "";
Object[4] = "Long Chalk Line"; Object[5] = "Short Chalk Line";
Object[6] = "Short Ahead Arrow";Object[7] = "Long Ahead Arrow";
Object[20] = "Red+White Cone";
Object[21] = "Red Cone";
Object[22] = "Striped Code";
return Object[ObjectIndex];
}
Event OnObjectCollision($userName,$ObjectFlag,$ObjectHitTime,$Object_X,$Object_Y,$TypeObject) # Player event
Globalmsg("".getplayervar($userName,"NickName")."^8 hit a ^3".$TypeObject." ^8at ".GetCurrentPlayerVar("ObjectContactSpeed")." km/h");
EndEvent
$userName // $Username
$objectflag // Flag of object
OBH_LAYOUT, //1 // an added object
OBH_CAN_MOVE, //2 // a movable object
OBH_WAS_MOVING, //4 // was moving before this hit
OBH_ON_SPOT //8 // object in original position
$Time //Time you hit the object (Race timer) in milliseconds
$XPos // Object X Coordinate
$YPos // Object Y Coordinate
// If an autocross object is hit (2 second time penalty) this packet is sent :
struct IS_AXO // AutoX Object
{
byte Size; // 4
byte Type; // ISP_AXO
byte ReqI; // 0
byte PLID; // player's unique id
};