| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- // -----------------------------------------------------------------------------
- // Example Filterscript for the LS Wells Fargo Building Object
- // -----------------------------------------------------------
- // By Matite in March 2015
- //
- //
- // This script creates the edited LS Wells Fargo Building object and
- // removes the existing GTASA building object.
- //
- // Warning...
- // This script uses a total of:
- // * 1 object = 1 for the replacement building object
- // * Enables the /lswf command to teleport the player to the LS Wells Fargo Building
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- // -----------------------------------------------------------------------------
- // Includes
- // --------
- // SA-MP include
- #include <a_samp>
- // -----------------------------------------------------------------------------
- // Defines
- // -------
- // Used for messages sent to the player
- #define COLOR_MESSAGE_YELLOW 0xFFDD00AA
- // -----------------------------------------------------------------------------
- // Variables
- // ---------
- // Stores the created object number of the replacement building object so
- // it can be destroyed when the filterscript is unloaded
- new LSWellsFargoObject1; // Building object
- // -----------------------------------------------------------------------------
- // Callbacks
- // ---------
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- // Check command text
- if (strcmp("/lswf", cmdtext, true, 5) == 0)
- {
- // Set the interior
- SetPlayerInterior(playerid, 0);
- // Set player position and facing angle
- SetPlayerPos(playerid, 1448.43, -1468.28, 13.82);
- SetPlayerFacingAngle(playerid, 92);
- // Fix camera position after teleporting
- SetCameraBehindPlayer(playerid);
- // Send a gametext message to the player
- GameTextForPlayer(playerid, "~b~~h~LS Wells Fargo!", 3000, 3);
- // Exit here
- return 1;
- }
- // Exit here (return 0 as the command was not handled in this filterscript)
- return 0;
- }
- public OnFilterScriptInit()
- {
- // Display information in the Server Console
- print("\n");
- print(" |---------------------------------------------------");
- print(" |--- LS Wells Fargo Building Filterscript");
- print(" |-- Script v1.01");
- print(" |-- 6th March 2015");
- print(" |---------------------------------------------------");
- // Create the LS Wells Fargo Building object
- LSWellsFargoObject1 = CreateObject(19879, 1421.38, -1477.6, 42.2031, 0, 0, 0);
- // Display information in the Server Console
- print(" |-- LS Wells Fargo Building object created");
- print(" |---------------------------------------------------");
- // Loop
- for (new i = 0; i < MAX_PLAYERS; i++)
- {
- // Check if the player is connected and not a NPC
- if (IsPlayerConnected(i) && !IsPlayerNPC(i))
- {
- // Remove default GTASA Wells Fargo Building and LOD map objects for the player
- // (so any player currently ingame does not have to rejoin for them
- // to be removed when this filterscript is loaded)
- RemoveBuildingForPlayer(i, 4007, 1421.38, -1477.6, 42.2031, 250.0); // Building
- RemoveBuildingForPlayer(i, 4009, 1421.38, -1477.6, 42.2031, 250.0); // LOD
- }
- }
- // Exit here
- return 1;
- }
- public OnFilterScriptExit()
- {
- // Check for valid object
- if (IsValidObject(LSWellsFargoObject1))
- {
- // Destroy the Wells Fargo Building object
- DestroyObject(LSWellsFargoObject1);
- // Display information in the Server Console
- print(" |---------------------------------------------------");
- print(" |-- LS Wells Fargo Building object destroyed");
- }
- // Display information in the Server Console
- print(" |---------------------------------------------------");
- print(" |-- LS Wells Fargo Building Filterscript Unloaded");
- print(" |---------------------------------------------------");
- // Exit here
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- // Remove default GTASA Wells Fargo Building and LOD map objects for the player
- RemoveBuildingForPlayer(playerid, 4007, 1421.38, -1477.6, 42.2031, 250.0); // Building
- RemoveBuildingForPlayer(playerid, 4009, 1421.38, -1477.6, 42.2031, 250.0); // LOD
- // Exit here (return 1 so this callback is handled in other scripts too)
- return 1;
- }
|