27.11.2011, 07:34
Dynamic Dealership System
Here's a better script that everybody wishes to have. It's a dynamic dealership system where you can create dealerships (and players can buy them, and collect earnings from their cars). Dealership owners can use /earnings to check their earnings, /collectearnings to collect them, /createcar to create a dealership vehicle, and /selldealership to sell their dealership.Dealerships can be created in-game by RCON admins using /createdealer. The params are: price, radius and name. Example: /createdealer 15000 30 Grotti Cars The radius is where the owner can create their cars in, and ONLY there. Anywhere outside the radius will give them an error.
ALL player-owned vehicles are using PVars also, not variables. The PVar system was said to be slow so keep MAX_OWNABLE_CARS under 20 to avoid any conflicts with lag.
All you need is the SII script. This script uses a built-in version of sscanf and dcmd (why dcmd? because it's not an include! i'm too lazy to actually use zcmd nowadays lol)
For now, players can only buy vehicles, and /park, /lock and /delete them. I've written this when I was bored one day, and I was so sleepy all I did was three commands. I'll be adding more in the future.
YOU MUST HAVE THESE FOLDERS IN YOUR SCRIPTFILES!
dealerships
dealerships/vehicles
ownedcars
Features:
• Allows RCON admins to create / destroy dealerships.
• Players can buy dealerships and collect money from it
• Players can check how much money they made from sales
• Players can create vehicles using /createcar in their dealership's radius
• You can own 3 cars (it can be changed by editing MAX_OWNABLE_CARS in the script)
Credits to:
• Slick for his SII file saving system.
• Dracoblue for the dcmd macro.
• ****** for the sscanf stock.
• SlashQ for the main scripting.
dealer.zip - Solidfiles (contains scriptfiles, .pwn and .amx, and include)
SII.inc - Solidfiles
dealer.pwn - Pastebin
SII.inc - Pastebin