• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
Resource icon

[TFS 1.4.2] Item Rental System! 2024-05-31

No permission to download
A gentleman asked me to create an item rental system. For instance, the owner rented a 'magic sword' to a player for 10 minutes and paid accordingly. Money and items should be placed in the 'ammo' slot to use the '!rent Matheus xxx' command, where 'xxx' is the desired value. If the value is 10,000 coins or more, or any currency ID, a currency bag must be placed in the 'ammo' slot to negotiate with the owner and rent the item for a specific time. Upon expiry, the item returns to the owner. If the owner is online, it returns directly to their backpack; if offline, it goes to their depot. Ideal for Baiak-style maps or any RPG-themed map. I hope you like it :)

Include a block on items; they cannot be moved to the ground or house until the timer expires, and they also cannot be traded. Regarding the real-time appearance of the rental item...

Note that if the rarity is rare or has enchanted/upgraded attributes, renting it to another player will not cause it to lose these features. Yes, the rarity or enchanted attributes remain unchanged.


I'll run a test with a 10-second GIF so you can understand how this system works, with items negotiated and returned to the owner from the client.
tradonlin.gif


Now, if the owner is offline, the item will be returned to the owner's depot, as shown here.
tradoff.gif

Just download the file and move it to data/scripts. It's a revscript, so enjoy :)



attention: you need to execute this in your SQL database.
SQL:
CREATE TABLE IF NOT EXISTS `rented_items` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `item_id` INT NOT NULL,
    `item_count` INT NOT NULL,
    `owner_player_guid` INT NOT NULL,
    `renter_player_guid` INT NOT NULL,
    `expiry_time` INT NOT NULL
);

and
SQL:
ALTER TABLE `players`
ADD COLUMN `storageItemReturned` INT DEFAULT 0;


Author
Mateus Robeerto
Downloads
33
Views
1,099
First release
Last update

Ratings

0.00 star(s) 0 ratings
Back
Top