Adding a New Corner
Adding a New Corner
This guide will walk you through modifying the configuration file to add a new corner. Follow the steps below to update your configuration and test your changes in-game.
Prerequisites
Access to the File: Ensure you have access to the file at
rm_illegalcorners/cfg.lua
.Basic Understanding: Familiarity with editing Lua files and using your script’s commands in-game.
1. Open the Configuration File
Locate and open the file:
2. Understand the Configuration Tables
The configuration file contains two primary sections: the Items Table and the Corners Table.
Items Table
This table defines the items that can be selled at any corner. For example:
Corners Table
This table specifies the corner locations and the items available at each corner. Each corner includes a zoneData
property that defines its active area.
3. Add Your New Corner
To add a new corner, simply append a new configuration object to the cfg.corners
table. Below are examples for each zone type.
Example: Sphere Zone
Example: Box Zone
Example: Polygon Zone
Your final configuration might look like this:
4. Save and Restart
Save the File: Save your changes to
cfg.lua
.Restart the Script: Restart your script or resource to load the new configuration.
5. Test Your New Corner
Launch the Game: Start the game and connect to your server.
Navigate to Your Corner: Head to the coordinates you specified for your new corner.
Start Interaction: Once you're in the zone, open the chat or console and type:
6. Troubleshooting
Incorrect Zone Data: Verify that you are using the correct properties for each zone type:
Polygon: Use
points
andthickness
.Box: Use
coords
andsize
.Sphere: Use
coords
andradius
.
Coordinate Errors: Check that all coordinates, sizes, and radius values are correct.
Item Key Mistakes: Confirm that every item referenced in the
items
array exists incfg.items
.Script Not Reloading: Ensure you have properly restarted the resource after making changes.
Conclusion
By following these steps, you have successfully added a new corner using the updated zone configurations. Customize the items, zone types, and coordinates as needed to create a dynamic and flexible experience with your script.
Happy Scripting!
Last updated