Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[forums.alliedmods.net] Shop System + API


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7 476
  • Lokalizacja:AMXX.PL
Offline

Napisano 31.01.2012 21:58


Shop System + API
Version 0.0.1
by Exolent



Introduction

This is an advanced management plugin for a Shop menu that is highly extensive.
It allows coders to build a quick and easy shop menu that is customized to their needs.

Cvars
  • shop_menu_title <title>
    - The title of the shop menu that is displayed to players
    - Use "{$money}" to be replaced with the player's actual money
    - Color codes and new lines are supported
    - The default color for the title is yellow
    - Default: "Shop Menu^nwYou have y{$money}"
  • shop_chat_tag <tag>
    - The prefix before any message in the chat shown from the Shop plugin
    - Do not include the space in the tag
    - Default: "[SHOP]"
  • shop_spawn_menu <0|1>
    - Shows the shop menu every time you spawn
    - 0 = Disabled
    - 1 = Enabled
    - Default: 0
Client Commands
  • say /shop
    - Opens up the shop menu
Requirements
  • AMX Mod X version 1.8.1 or higher
Installation

You will need to compile this plugin locally with the shop.inc include file.

Once compiled, install the .amxx file like any other plugin.

If you have any chat plugins (color chat, chat tag, etc.) make sure
they are below this plugin in the plugins.ini, or else "/shop" command will not work.

Plugin API

See the shop.inc file for all API documentation.
See attached plugins for examples on using the API.

What you can do:

  • Easily add items to the menu, all you have to do is make the items work!
  • Force players to open the menu
  • Override the shop plugin from using CS money to use your own system (point system plugin, unlimited money, etc.)

Generated Cvars

There are cvars generated for every item in the menu:

  • shop_item_(name)_enabled <0|1>
    - Determines whether an item is enabled at all in the menu
    - 0 = Disabled (hidden from menu)
    - 1 = Enabled
    - Default: 1
  • shop_item_(name)_cost <cost>
    - The cost of an item in the menu
    - 0 = No cost is shown in the menu
    - Default: (dependent on plugin)
  • shop_item_(name)_team <team>
    - List of teams that can use this item
    - 0 = All teams
    - 1 = Terrorists
    - 2 = Counter-Terrorists
    - 3 = Spectators
    - You can combine 1-3 with commas (eg. "1,3") to exclude 1 team
    - Default: (dependent on plugin)
  • shop_item_(name)_delay <seconds>
    - Delay in seconds between usages of an item
    - 0 = No delay
    - (-1) = Once per round
    - Default: (dependent on plugin)
Changelog

0.0.1

  • Initial release

Notes

All example plugins are not going to be updated and are only there for examples.
Any features you may want added (do not ask for items to be made) will be considered and, if reasonable, will be made.
This is not the place to ask for items to be made. Make a topic in Suggestions/Requests.



Attached Files Dołączona grafika Get Plugin or Get Source (shop_api.sma - 11.7 KB) Dołączona grafika shop.inc (4.3 KB) Dołączona grafika Get Plugin or Get Source (shop_item_gravity.sma - 1,020 Bytes) Dołączona grafika Get Plugin or Get Source (shop_item_multi.sma - 5.9 KB) Dołączona grafika Get Plugin or Get Source (shop_money_example1.sma - 1.9 KB) Dołączona grafika Get Plugin or Get Source (shop_money_example2.sma - 771 Bytes)

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych