Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

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

OciXCrom's Custom Shop 3.3 + 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:7173
  • Lokalizacja:AMXX.PL
Offline

Napisano 29.06.2016 20:52

<div><font face="Comic Sans MS"><div align="center"><font size="4"><b><u><font color="#408000">OciXCrom's Custom Shop v3.3 + API</font></u></b></font><br /><br /><img src="http://i.imgur.com/BeBlzhj.jpg"border="0" alt="" /></div><br /><b><font size="4"><font color="#408000">☄</font> Description</font></b><br /><ul><li>This plugin adds a unique shop in the game that contains a variety of different settings which makes it highly customizable. The shop has got a special points system that can be activated through the configuration file. It also has an API which allows you to easily add more items, as well as remove some of the default ones.</li>
</ul><br /><b><font size="4"><font color="#408000">☄</font> Installation</font></b><br /><ul><li>Bear in mind that the plugin consists of two different files that need to be added in the plugins list.</li>
</ul><ul><li>The files <b><font color="#FF8000">custom_shop.amxx</font></b> and <b><font color="#FF8000">cshop_items.amxx</font></b> go in the <b><font color="#0040FF">plugins</font></b> folder. The first one is the main plugin, i.e. the shop can't work without it. The second one contains all the default shop items, so you can decide not to add it if you plan to add your own custom items.</li>
<li>The files <b><font color="#FF8000">custom_shop.sma</font></b> and <b><font color="#FF8000">cshop_items.sma</font></b> go in the <b><font color="#0040FF">scripting</font></b> folder. It is highly recommended to compile them locally and replace them with the new <b><font color="#0040FF">.amxx</font></b> files.</li>
<li>The file <b><font color="#FF8000">customshop.inc</font></b> goes in <b><font color="#0040FF">scripting/include</font></b>. This is the plugin's API. There you can find all of the functions that are used to create sub-plugins.</li>
<li>The file <b><font color="#FF8000">cshop_settings.inc</font></b> goes in <b><font color="#0040FF">scripting/include</font></b>.</li>
<li>In <b><font color="#0040FF">configs/plugins.ini</font></b> you need to add <b><u>only</u></b> <b><font color="#FF8000">custom_shop.amxx</font></b>.</li>
<li>In <b><font color="#0040FF">configs/plugins-cshop.ini</font></b> you need to add <b><font color="#FF8000">cshop_items.amxx</font></b>. All sub-plugins go in that file. You can add them in <b><font color="#0040FF">configs/plugins.ini</font></b> as well, but they must be placed underneath <b><font color="#FF8000">custom_shop.amxx</font></b>.</li>
</ul><br /><b><font size="4"><font color="#408000">☄</font> Default items</font></b><br /><ul><li>This is a list of all items that are added in the shop by default. Names, prices, limits and everything else can be changed by editing <b><font color="#FF8000">cshop_items.sma</font></b>.</li>
<li>To remove an item, add <b><font color="#008000">//</font></b> in the beginning of the line that contains the function <b><font color="#008000">cshopRegisterItem</font></b>. The plugin needs to be compiled locally after the changes.<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">ITEM_GRAVITY&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cshopRegisterItem</span><span style="color: #007700">(</span><span style="color: #0000BB">GRAVITY_NAME</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">GRAVITY_PRICE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">GRAVITY_LIMIT</span><span style="color: #007700">)&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">//ITEM_GRAVITY&nbsp;=&nbsp;cshopRegisterItem(GRAVITY_NAME,&nbsp;GRAVITY_PRICE,&nbsp;GRAVITY_LIMIT)&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></li>
</ul><ul><li><b><font color="#FF8000">+50 Health</font></b> -- Gives +50 HP.<ul><li><b><font color="#BF0000">Price</font></b>: 1500</li>
<li><b><font color="#BF0000">Limit</font></b>: 5</li>
</ul></li>
<li><b><font color="#FF8000">+100 Armor</font></b> -- Gives +100 AP.<ul><li><b><font color="#BF0000">Price</font></b>: 1000</li>
<li><b><font color="#BF0000">Limit</font></b>: 8</li>
</ul></li>
<li><b><font color="#FF8000">Unlimited Clip</font></b> -- Unlimited bullets for your curent weapon (no reload). This item cannot be activated on a weapon that doesn't use bullets.<ul><li><b><font color="#BF0000">Price</font></b>: 3000</li>
<li><b><font color="#BF0000">Limit</font></b>: 3</li>
</ul></li>
<li><b><font color="#FF8000">Unlimited Ammo</font></b> -- Unlimited backpack ammo for your current weapon. This item cannot be activated on a weapon that doesn't use bullets.<ul><li><b><font color="#BF0000">Price</font></b>: 200</li>
<li><b><font color="#BF0000">Limit</font></b>: 5</li>
</ul></li>
<li><b><font color="#FF8000">Bomber</font></b> -- Gives +20 HE grenades.<ul><li><b><font color="#BF0000">Price</font></b>: 1600</li>
<li><b><font color="#BF0000">Limit</font></b>: 3</li>
</ul></li>
<li><b><font color="#FF8000">Silent Footsteps</font></b> -- You won't make any sounds when walking.<ul><li><b><font color="#BF0000">Price</font></b>: 3000</li>
<li><b><font color="#BF0000">Limit</font></b>: 1</li>
</ul></li>
<li><b><font color="#FF8000">Faster Speed</font></b> -- Increases your speed.<ul><li><b><font color="#BF0000">Price</font></b>: 4300</li>
<li><b><font color="#BF0000">Limit</font></b>: 1</li>
</ul></li>
<li><b><font color="#FF8000">Low Gravity</font></b> -- Allows you to jump higher.<ul><li><b><font color="#BF0000">Price</font></b>: 2800</li>
<li><b><font color="#BF0000">Limit</font></b>: 1</li>
</ul></li>
<li><b><font color="#FF8000">Chameleon</font></b> -- You get a random skin from the enemy team.<ul><li><b><font color="#BF0000">Price</font></b>: 9000</li>
<li><b><font color="#BF0000">Limit</font></b>: 1</li>
</ul></li>
<li><b><font color="#FF8000">Drugs (Speed + Health)</font></b> -- Distorts your screen, increases your speed and adds additional health.<ul><li><b><font color="#BF0000">Price</font></b>: 8000</li>
<li><b><font color="#BF0000">Limit</font></b>: 2</li>
</ul></li>
<li><b><font color="#FF8000">Transparency</font></b> -- Makes you transparent.<ul><li><b><font color="#BF0000">Price</font></b>: 2500</li>
<li><b><font color="#BF0000">Limit</font></b>: 1</li>
</ul></li>
<li><b><font color="#FF8000">Invisibility (15 Seconds)</font></b> -- You become fully invisible for 15 seconds.<ul><li><b><font color="#BF0000">Price</font></b>: 16000</li>
<li><b><font color="#BF0000">Limit</font></b>: 1</li>
</ul></li>
<li><b><font color="#FF8000">Double Damage</font></b> -- Doubles the damage you make.<ul><li><b><font color="#BF0000">Price</font></b>: 10000</li>
<li><b><font color="#BF0000">Limit</font></b>: 1</li>
</ul></li>
<li><b><font color="#FF8000">Godmode (5 Seconds)</font></b> -- You become immortal for 5 seconds.<ul><li><b><font color="#BF0000">Price</font></b>: 16000</li>
<li><b><font color="#BF0000">Limit</font></b>: 1</li>
</ul></li>
<li><b><font color="#FF8000">Health Regeneration</font></b> -- You get +1 HP each second.<ul><li><b><font color="#BF0000">Price</font></b>: 1800</li>
<li><b><font color="#BF0000">Limit</font></b>: 1</li>
</ul></li>
<li><b><font color="#FF8000">Armor Regeneration</font></b> -- You get +10 AP each second.<ul><li><b><font color="#BF0000">Price</font></b>: 2000</li>
<li><b><font color="#BF0000">Limit</font></b>: 1</li>
</ul> </li>
</ul><ul><li>The items' points price is dependant of the money price, so the price you pay using points is 10 times smaller than the money price. If you want to change the points price for a specific item, add <b><font color="#BF0080">.points = &lt;NEW PRICE HERE&gt;</font></b> in the function <b><font color="#008000">cshopRegisterItem</font></b>.<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">ITEM_HEALTH&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cshopRegisterItem</span><span style="color: #007700">(</span><span style="color: #0000BB">HEALTH_NAME</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">HEALTH_PRICE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">HEALTH_LIMIT</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">HEALTH_SOUND</span><span style="color: #007700">,&nbsp;.</span><span style="color: #0000BB">points&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">12</span><span style="color: #007700">)&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></li>
</ul><br /><b><font size="4"><font color="#FF8000">☄</font> Admin commands</font></b><br /><ul><li><b><font color="#FF8000">cshop_points &lt;nick|#userid&gt; &lt;amount&gt;</font></b> -- Gives/Takes points to/from the player.</li>
<li><b><font color="#FF8000">cshop_items</font></b> -- A list of all registered items.</li>
</ul><br /><b><font size="4"><font color="#FF8000">☄</font> Settings</font></b><br /><ul><li>The settings can be changed in the file <b><font color="#0040FF">configs/CustomShop.ini</font></b>, and the messages in <b><font color="#0040FF">data/lang/CustomShop.txt</font></b>.</li>
</ul><ul><li><b><font color="#FF8000">CSHOP_PREFIX</font></b> -- Prefix for chat messages.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: !n[!tCustom Shop!n]</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_TITLE</font></b> -- Menu title..<ul><li><b><font color="#BF0000">DEFAULT</font></b>: yOciXCrom's rCustom Shop</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_TITLE_PAGE</font></b> -- The text that will be added to the title if the menu has more than one page.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: d| w%page%:d</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_TEAM_NAMES</font></b> -- Team names when using %team% in the title.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: Unassigned, Terrorist, Counter-Terrorist, Spectator</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_SOUND_ERROR</font></b> -- Error sound.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: buttons/button11.wav</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_SOUND_EXPIRE</font></b> -- The sound when an item expires.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: buttons/blip2.wav</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_SOUND_OPEN</font></b> -- The sound when you open the shop.<ul><li><b><font color="#BF0000">DEFAULT</font></b>:</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_BUYSOUND_TYPE</font></b> -- 0 = everyone around the player hears the sound when you buy an item; 1 = only the player hears it<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_EXPIRESOUND_TYPE</font></b> -- 0 = everyone around the player hears the sound when an item expires; 1 = only the player hears it<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_OPENSOUND_TYPE</font></b> -- 0 = everyone around the player hears the sound when the shop is opened; 1 = only the player hears it<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 1</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_COMMANDS</font></b> -- Commands that open the shop.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: say /shop , say_team /shop , customshop</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_PREVPAGE</font></b> -- Previous page field.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: Previous page</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_NEXTPAGE</font></b> -- Next page field.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: Next page</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_EXITMENU</font></b> -- Exit menu field.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: rClose</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_PERPAGE</font></b> -- Number of items on each page.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 7</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_FLAG</font></b> -- If you want the shop to be available for players with a certain flag only.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: !</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_TEAM</font></b> -- If you want the shop to be available for a certain team only.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_SHOW_TEAMED</font></b> -- Controls whether items that aren't meant for your team will be displayed in the menu.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_ITEM_TEAMED</font></b> -- Text for items that aren't meant for your team.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: r[yTEAMEDr]</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_SHOW_FLAGGED</font></b> -- Controls whether items that you don't have access to will be displayed in the menu.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_ITEM_FLAGGED</font></b> -- Text for items that you don't have access to.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: r[yFLAGGEDr]</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_LIMIT_TYPE</font></b> -- How is the item limit going to work (0 = every players has his own limit; 1 = every team has his own limit; 2 = limit is the same for all players).<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_HIDE_LIMITED</font></b> -- If you want to hide items that have reached their limit.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_OPEN_AT_SPAWN</font></b> -- If you want the shop to be displayed on spawn.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul> </li>
</ul><ul><li><b><font color="#FF8000">CSHOP_POINTS_ENABLE</font></b> -- Enables/Disables the points system.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_MONEY_NAME</font></b> -- Money name.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: money</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_POINTS_NAME</font></b> -- Points name.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: points</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_MONEY_CURRENCY</font></b> -- Money currency.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: $</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_POINTS_CURRENCY</font></b> -- Points currency.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: Pts.</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_POINTS_SAVE</font></b> -- How to save the points (0 = name; 1 = IP address; 2= SteamID)<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_POINTS_COMMANDS</font></b> -- Commands that allow you to see how many points you have.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: say /points , say_team /points</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_REWARD_NORMAL</font></b> -- Reward for a normal kill.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 15</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_REWARD_HEADSHOT</font></b> -- Reward for a headshot kill.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 30</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_REWARD_KNIFE</font></b> -- Reward for a knife kill.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 50</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_REWARD_VIP</font></b> -- If you want VIP users to get additional points for each kill<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_VIP_FLAG</font></b> -- VIP flag for the setting above.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: b</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_POINTS_TEAMKILL</font></b> -- Controls whether you get points for killing teammates.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_KILL_MESSAGE</font></b> -- Enables/Disables the message when you kill a player.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_HUD_ENABLED</font></b> -- Enables/Disables points being displayed on the HUD.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_HUD_RED</font></b> -- Red color amount for the HUD message.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 255</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_HUD_GREEN</font></b> -- Green color amount for the HUD message.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 255</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_HUD_BLUE</font></b> -- Blue color amount for the HUD message.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_HUD_X</font></b> -- X position for the HUD message.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0.01</li>
</ul></li>
<li><b><font color="#FF8000">CSHOP_HUD_Y</font></b> -- Y position for the HUD message.<ul><li><b><font color="#BF0000">DEFAULT</font></b>: 0.93</li>
</ul> </li>
</ul><br /><b><font size="4"><font color="#408000">☄</font> How to add additional settings to an item</font></b><br /><ul><li>The settings require editing the file <b><font color="#0040FF">cshop_items.sma</font></b>. If you use a sub-plugin for the item, you will need to edit that plugin's code.</li>
</ul><ul><li>To add an additional setting, e.g. duration, i.e. make the item automatically expire after a certain time, you need to edit the line that registeres the item. In this example we'll use the item for low gravity, i.e. <b><font color="#BF8080">ITEM_GRAVITY</font></b>.<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">ITEM_GRAVITY&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cshopRegisterItem</span><span style="color: #007700">(</span><span style="color: #0000BB">GRAVITY_NAME</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">GRAVITY_PRICE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">GRAVITY_LIMIT</span><span style="color: #007700">)&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></li>
<li>If you want to add duration, simply add .seconds = &lt;DURATION IN SECONDS&gt; at the end of the line.<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">ITEM_GRAVITY&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cshopRegisterItem</span><span style="color: #007700">(</span><span style="color: #0000BB">GRAVITY_NAME</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">GRAVITY_PRICE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">GRAVITY_LIMIT</span><span style="color: #007700">,&nbsp;.</span><span style="color: #0000BB">seconds&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">15.0</span><span style="color: #007700">)&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></li>
<li>If you want to make the item available for a certain team only, add .team = &lt;TEAM ID&gt;.<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">ITEM_GRAVITY&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cshopRegisterItem</span><span style="color: #007700">(</span><span style="color: #0000BB">GRAVITY_NAME</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">GRAVITY_PRICE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">GRAVITY_LIMIT</span><span style="color: #007700">,&nbsp;.</span><span style="color: #0000BB">team&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">)&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></li>
<li>You can also add a different buy sound, duration, points price, team and flag. The choice is yours.<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">ITEM_GRAVITY&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cshopRegisterItem</span><span style="color: #007700">(</span><span style="color: #0000BB">GRAVITY_NAME</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">GRAVITY_PRICE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">GRAVITY_LIMIT</span><span style="color: #007700">,&nbsp;.</span><span style="color: #0000BB">sound&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"misc/gravity.wav"</span><span style="color: #007700">,&nbsp;.</span><span style="color: #0000BB">time&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">20.0</span><span style="color: #007700">,&nbsp;.</span><span style="color: #0000BB">points&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">15</span><span style="color: #007700">,&nbsp;.</span><span style="color: #0000BB">team&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">2</span><span style="color: #007700">,&nbsp;.</span><span style="color: #0000BB">flag&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"b"</span><span style="color: #007700">)&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></li>
</ul><br /><b><font size="4"><font color="#408000">☄</font> Using a currency from another plugin/mod</font></b><br /><ul><li>The plugin has the ability to use another plugin's natives instead of default money. In simple terms - you can make the shop work with Ammo Packs, BaseBuilder Credits, JBPacks etc. To achieve that, you need to edit the following lines in the file <b><font color="#0040FF">cshop_settings.inc</font></b>:<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">#define&nbsp;get_user_money(%1)&nbsp;cs_get_user_money(%1)<br />#define&nbsp;set_user_money(%1,%2)&nbsp;cs_set_user_money(%1,&nbsp;%2)&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></li>
<li>To make it use Ammo Packs, replace the lines with these:<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">#define&nbsp;get_user_money(%1)&nbsp;zp_get_user_ammo_packs(%1)<br />#define&nbsp;set_user_money(%1,%2)&nbsp;zp_set_user_ammo_packs(%1,&nbsp;%2)&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></li>
<li>Also, add the natives that you used in both lines:<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB">native&nbsp;zp_get_user_ammo_packs</span><span style="color: #007700">(</span><span style="color: #0000BB">id</span><span style="color: #007700">)<br /></span><span style="color: #0000BB">native&nbsp;zp_set_user_ammo_packs</span><span style="color: #007700">(</span><span style="color: #0000BB">id</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">amount</span><span style="color: #007700">)&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></li>
<li>Or:<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">#include&nbsp;&lt;zombieplague&gt;&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></li>
</ul><br /><b><font size="4"><font color="#408000">☄</font> Plugin API (customshop.inc)</font></b><br /><ul><li>The plugin also has an API, i.e. a library (.inc file), which allows you to make sub-plugins that will add additional items in the shop and many other things. Here's an example of a plugin that adds No Recoil in the shop (removes recoil when shooting).<br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">PHP Code:</div>
<div class="alt2">
<hr />
<code style="white-space:nowrap">
<div dir="ltr" style="text-align:left;">
<!-- php buffer start --><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #FF8000">#include&nbsp;&lt;amxmodx&gt;<br />#include&nbsp;&lt;customshop&gt;<br />#include&nbsp;&lt;fakemeta&gt;<br /><br />#define&nbsp;PLUGIN_VERSION&nbsp;"1.0"<br /><br /></span><span style="color: #0000BB">additem&nbsp;ITEM_NORECOIL<br /></span><span style="color: #FF8000">#define&nbsp;NORECOIL_NAME&nbsp;"No&nbsp;Recoil"<br />#define&nbsp;NORECOIL_PRICE&nbsp;12000<br />#define&nbsp;NORECOIL_LIMIT&nbsp;1<br /></span><span style="color: #007700">new&nbsp;</span><span style="color: #0000BB">bool</span><span style="color: #007700">:</span><span style="color: #0000BB">g_blNoRecoil</span><span style="color: #007700">[</span><span style="color: #0000BB">33</span><span style="color: #007700">]<br /><br />public&nbsp;</span><span style="color: #0000BB">plugin_init</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">register_plugin</span><span style="color: #007700">(</span><span style="color: #DD0000">"Custom&nbsp;Shop:&nbsp;No&nbsp;Recoil"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">PLUGIN_VERSION</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"OciXCrom"</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">register_forward</span><span style="color: #007700">(</span><span style="color: #0000BB">FM_PlayerPreThink</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"fwdPreThink"</span><span style="color: #007700">)<br />}<br /><br />public&nbsp;</span><span style="color: #0000BB">plugin_precache</span><span style="color: #007700">()<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ITEM_NORECOIL&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">cshopRegisterItem</span><span style="color: #007700">(</span><span style="color: #0000BB">NORECOIL_NAME</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">NORECOIL_PRICE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">NORECOIL_LIMIT</span><span style="color: #007700">)<br /><br />public&nbsp;</span><span style="color: #0000BB">cshopItemBought</span><span style="color: #007700">(</span><span style="color: #0000BB">id</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">iItem</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">iItem&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">ITEM_NORECOIL</span><span style="color: #007700">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="color: #0000BB">g_blNoRecoil</span><span style="color: #007700">[</span><span style="color: #0000BB">id</span><span style="color: #007700">]&nbsp;=&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />public&nbsp;</span><span style="color: #0000BB">cshopItemRemoved</span><span style="color: #007700">(</span><span style="color: #0000BB">id</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">iItem</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">iItem&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">ITEM_NORECOIL</span><span style="color: #007700">)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;</span><span style="color: #0000BB">g_blNoRecoil</span><span style="color: #007700">[</span><span style="color: #0000BB">id</span><span style="color: #007700">]&nbsp;=&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />public&nbsp;</span><span style="color: #0000BB">fwdPreThink</span><span style="color: #007700">(</span><span style="color: #0000BB">id</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">is_user_alive</span><span style="color: #007700">(</span><span style="color: #0000BB">id</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;</span><span style="color: #0000BB">g_blNoRecoil</span><span style="color: #007700">[</span><span style="color: #0000BB">id</span><span style="color: #007700">])<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">set_pev</span><span style="color: #007700">(</span><span style="color: #0000BB">id</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">pev_punchangle</span><span style="color: #007700">,&nbsp;{</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">0.0</span><span style="color: #007700">})&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></li>
</ul><ul><li><b><font color="#FF8000">cshopRegisterItem(name[], price, limit = 0, sound[] = DEFAULT_SOUND, Float:seconds = 0.0, points = 0, team = 0, flag[] = &quot;&quot;)</font></b> -- Registers a new item.</li>
<li><b><font color="#FF8000">cshopHasItem(id, item)</font></b> -- Checks whether a player has an item or not.</li>
<li><b><font color="#FF8000">cshopPointsEnabled()</font></b> -- Checks whether the points system is enabled.</li>
<li><b><font color="#FF8000">cshopGetLimit(id, item)</font></b> -- Checks player's item limit.</li>
<li><b><font color="#FF8000">cshopItemBought(id, item)</font></b> -- Called when an item is purchased.</li>
<li><b><font color="#FF8000">cshopItemRemoved(id, item)</font></b> -- Called when an item is removed.</li>
<li><b><font color="#FF8000">cshopRemoveItem(id, item)</font></b> -- Removes a player's item.</li>
<li><b><font color="#FF8000">cshopErrorSound(id)</font></b> -- Plays the error sound on a player.</li>
<li><b><font color="#FF8000">cshopTotalItems()</font></b> -- Gets the total number of loaded items.</li>
<li><b><font color="#FF8000">cshopGivePoints(id, points)</font></b> -- Give/Take points to/from a player.</li>
<li><b><font color="#FF8000">ColorChat(id, message[], any:...)</font></b> -- Sends a colored chat message.</li>
</ul><br /><b><font size="4"><font color="#408000">☄</font> Video preview (of an older version)</font></b><br /><br /><iframe width="420" height="315" src="https://www.youtube....PQvdDMbs?rel=0"frameborder="0" allowfullscreen></iframe><br /><br /><font size="1">* Click <a href="http://www.gametracker.com/search/?search_by=server_variable&amp;search_by2=customshop&amp;query=&amp;loc=_all&amp;sort=&amp;order=" target="_blank">here</a> to see all servers using this plugin.</font></font></div>


<br /> <div style="padding:6px">








<fieldset class="fieldset">
<legend>Attached Files</legend>
<table cellpadding="0" cellspacing="3" border="0">
<tr>
<td><img class="inlineimg" src="https://forums.allie...attach/zip.gif"alt="File Type: zip" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>


<a href="https://forums.allie...7230080">CustomShop v3.3 [AM].zip</a> (13.2 KB)


</td>
</tr>
</table>
</fieldset>


</div>

Wyświetl pełny artykuł




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

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