User Tools

Site Tools


scripting:samples:buildingproxevents

Building Proximity Event Sample

$kBuildingIDForProxEvents = 5
$kProxDistanceMeters = 40
$kBuildingHiddenTime = 30

// When player logs in activate a building proximity event for them
//  This means that whenever this player gets within range of the building,
//   the "BuildingProxEnter" event will be triggered
Event( "PlayerLogin", "" )
{
    sysActivateBuildingProximityEvent( $kBuildingIDForProxEvents, $kProxDistanceMeters )
}


// This event will be triggered when the player gets within 40m of Building Number 5
// The 'buildingspecialevent' command with mode 9 will hide the building for 30 seconds
Event( "BuildingIDProxEnter", "$kBuildingIDForProxEvents" )
{
   *grantitem %PLAYER%,1,Special Item
   *setvehicle %PLAYER% 3
   *explodebuilding $kBuildingIDForProxEvents
   *buildingspecialevent $kBuildingIDForProxEvents 9 $kBuildingHiddenTime 
}
scripting/samples/buildingproxevents.txt · Last modified: 2023/05/04 14:30 by mit

Except where otherwise noted, content on this wiki is licensed under the following license: Public Domain
Public Domain Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki