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

[CS:GO/ZP] ExtraItem: Infinity Ammo


  • 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:7174
  • Lokalizacja:AMXX.PL
Offline

Napisano 26.04.2016 14:21

<div>Give the infinity ammo for a player, who will buy it<br />Ammo will be reset during the infection<br /><br />Use <b>smlib.inc</b> and <b>zombieplague.inc</b> to compile the file.<br /><br /><div style="margin: 5px;">
<div class="smallfont" style="margin-bottom: 2px;">
<b>Spoiler</b> <input value="Show" style="margin: 0px; padding: 0px; width: 45px; font-size: 10px;" onclick="if(this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline')
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Hide'; }
else
{ this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Show'; }" type="button">
</div>
<div class="alt2" style="border: 1px inset; padding: 6px;">
<div class="spoiler" style="display: none;"><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">/**<br />&nbsp;*&nbsp;============================================================================<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;Zombie&nbsp;Plague&nbsp;Mod&nbsp;#3&nbsp;Generation<br />&nbsp;*<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;Copyright&nbsp;©&nbsp;2015&nbsp;Nikita&nbsp;Ushakov&nbsp;(Ireland,&nbsp;Dublin)<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;This&nbsp;program&nbsp;is&nbsp;free&nbsp;software:&nbsp;you&nbsp;can&nbsp;redistribute&nbsp;it&nbsp;and/or&nbsp;modify<br />&nbsp;*&nbsp;&nbsp;it&nbsp;under&nbsp;the&nbsp;terms&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;as&nbsp;published&nbsp;by<br />&nbsp;*&nbsp;&nbsp;the&nbsp;Free&nbsp;Software&nbsp;Foundation,&nbsp;either&nbsp;version&nbsp;3&nbsp;of&nbsp;the&nbsp;License,&nbsp;or<br />&nbsp;*&nbsp;&nbsp;(at&nbsp;your&nbsp;option)&nbsp;any&nbsp;later&nbsp;version.<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;This&nbsp;program&nbsp;is&nbsp;distributed&nbsp;in&nbsp;the&nbsp;hope&nbsp;that&nbsp;it&nbsp;will&nbsp;be&nbsp;useful,<br />&nbsp;*&nbsp;&nbsp;but&nbsp;WITHOUT&nbsp;ANY&nbsp;WARRANTY;&nbsp;without&nbsp;even&nbsp;the&nbsp;implied&nbsp;warranty&nbsp;of<br />&nbsp;*&nbsp;&nbsp;MERCHANTABILITY&nbsp;or&nbsp;FITNESS&nbsp;FOR&nbsp;A&nbsp;PARTICULAR&nbsp;PURPOSE.&nbsp;&nbsp;See&nbsp;the<br />&nbsp;*&nbsp;&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License&nbsp;for&nbsp;more&nbsp;details.<br />&nbsp;*<br />&nbsp;*&nbsp;&nbsp;You&nbsp;should&nbsp;have&nbsp;received&nbsp;a&nbsp;copy&nbsp;of&nbsp;the&nbsp;GNU&nbsp;General&nbsp;Public&nbsp;License<br />&nbsp;*&nbsp;&nbsp;along&nbsp;with&nbsp;this&nbsp;program.&nbsp;&nbsp;If&nbsp;not,&nbsp;see&nbsp;&lt;http://www.gnu.org/l...enses/&#62;.<br/>&nbsp;*<br />&nbsp;*&nbsp;============================================================================<br />&nbsp;**/<br /><br />#include&nbsp;&lt;sourcemod&gt;<br />#include&nbsp;&lt;sdktools&gt;<br />#include&nbsp;&lt;sdkhooks&gt;<br />#include&nbsp;&lt;smlib&gt;<br />#include&nbsp;&lt;zombieplague&gt;<br /><br />#pragma&nbsp;newdecls&nbsp;required<br /><br />/**<br />&nbsp;*&nbsp;@section&nbsp;Information&nbsp;about&nbsp;extra&nbsp;items.<br />&nbsp;**/<br />#define&nbsp;EXTRA_ITEM_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"Infinity&nbsp;Ammo"&nbsp;<br />#define&nbsp;EXTRA_ITEM_COST&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;15<br />#define&nbsp;EXTRA_ITEM_LEVEL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />#define&nbsp;EXTRA_ITEM_ONLINE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />#define&nbsp;EXTRA_ITEM_LIMIT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0<br />/**<br />&nbsp;*&nbsp;@endsection<br />&nbsp;**/<br />&nbsp;<br />/**<br />&nbsp;*&nbsp;Record&nbsp;plugin&nbsp;info.<br />&nbsp;**/<br /></span><span style="color: #007700">public&nbsp;</span><span style="color: #0000BB">Plugin&nbsp;myinfo&nbsp;</span><span style="color: #007700">=<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"[ZP]&nbsp;ExtraItem:&nbsp;infinity&nbsp;Ammo"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">author&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"qubka&nbsp;(Nikita&nbsp;Ushakov)"</span><span style="color: #007700">,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">description&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">""</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"1.0"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">url&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #DD0000">"https://forums.alliedmods.net/showthread.php?t=272546"<br /></span><span style="color: #007700">}<br /><br /></span><span style="color: #FF8000">//&nbsp;Item&nbsp;index<br /></span><span style="color: #0000BB">int&nbsp;iItem</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">//&nbsp;Boolean<br /></span><span style="color: #0000BB">bool&nbsp;InfinityAmmo</span><span style="color: #007700">[</span><span style="color: #0000BB">MAXPLAYERS</span><span style="color: #007700">+</span><span style="color: #0000BB">1</span><span style="color: #007700">];<br /><br /></span><span style="color: #FF8000">/**<br />&nbsp;*&nbsp;Plugin&nbsp;is&nbsp;loading.<br />&nbsp;**/<br /></span><span style="color: #007700">public&nbsp;</span><span style="color: #0000BB">void&nbsp;OnPluginStart</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Initilizate&nbsp;extra&nbsp;item<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">iItem&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">ZP_RegisterExtraItem</span><span style="color: #007700">(</span><span style="color: #0000BB">EXTRA_ITEM_NAME</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">EXTRA_ITEM_COST</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">ZP_TEAM_HUMAN</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">EXTRA_ITEM_LEVEL</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">EXTRA_ITEM_ONLINE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">EXTRA_ITEM_LIMIT</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Hook&nbsp;spawn&nbsp;event<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">HookEvent</span><span style="color: #007700">(</span><span style="color: #DD0000">"weapon_fire"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">OnWeaponFire</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">EventHookMode_Post</span><span style="color: #007700">);<br />}<br /><br /></span><span style="color: #FF8000">/**<br />&nbsp;*&nbsp;Event&nbsp;callback&nbsp;(weapon_fire)<br />&nbsp;*&nbsp;The&nbsp;player&nbsp;is&nbsp;spawning.<br />&nbsp;*&nbsp;<br />&nbsp;*&nbsp;@param&nbsp;gEventHook&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;event&nbsp;handle.<br />&nbsp;*&nbsp;@param&nbsp;gEventName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Name&nbsp;of&nbsp;the&nbsp;event.<br />&nbsp;*&nbsp;@dontBroadcast&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If&nbsp;true,&nbsp;event&nbsp;is&nbsp;broadcasted&nbsp;to&nbsp;all&nbsp;clients,&nbsp;false&nbsp;if&nbsp;not.<br />&nbsp;**/<br /></span><span style="color: #007700">public&nbsp;</span><span style="color: #0000BB">Action&nbsp;OnWeaponFire</span><span style="color: #007700">(</span><span style="color: #0000BB">Event&nbsp;gEventHook</span><span style="color: #007700">,&nbsp;const&nbsp;</span><span style="color: #0000BB">char</span><span style="color: #007700">[]&nbsp;</span><span style="color: #0000BB">gEventName</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">bool&nbsp;iDontBroadcast</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Get&nbsp;real&nbsp;player&nbsp;index&nbsp;from&nbsp;event&nbsp;key<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">int&nbsp;clientIndex&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">GetClientOfUserId</span><span style="color: #007700">(</span><span style="color: #0000BB">GetEventInt</span><span style="color: #007700">(</span><span style="color: #0000BB">gEventHook</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">"userid"</span><span style="color: #007700">));&nbsp;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Verify&nbsp;that&nbsp;the&nbsp;client&nbsp;is&nbsp;exist<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">IsPlayerExist</span><span style="color: #007700">(</span><span style="color: #0000BB">clientIndex</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;If&nbsp;the&nbsp;client&nbsp;have&nbsp;infinity&nbsp;ammo<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">InfinityAmmo</span><span style="color: #007700">[</span><span style="color: #0000BB">clientIndex</span><span style="color: #007700">])<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Get&nbsp;active&nbsp;weapon<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">int&nbsp;iWeapon&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Client_GetActiveWeapon</span><span style="color: #007700">(</span><span style="color: #0000BB">clientIndex</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;If&nbsp;weapon&nbsp;exist<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">iWeapon&nbsp;</span><span style="color: #007700">!=&nbsp;</span><span style="color: #0000BB">INVALID_ENT_REFERENCE</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Get&nbsp;ammo&nbsp;in&nbsp;clip<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">int&nbsp;iClip1&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Weapon_GetPrimaryClip</span><span style="color: #007700">(</span><span style="color: #0000BB">iWeapon</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">int&nbsp;iClip2&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">Weapon_GetSecondaryClip</span><span style="color: #007700">(</span><span style="color: #0000BB">iWeapon</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Set&nbsp;new&nbsp;amount&nbsp;of&nbsp;ammo<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">iClip1&nbsp;</span><span style="color: #007700">&gt;&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">Weapon_SetPrimaryClip</span><span style="color: #007700">(</span><span style="color: #0000BB">iWeapon</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">iClip1</span><span style="color: #007700">+</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">iClip2&nbsp;</span><span style="color: #007700">&gt;&nbsp;-</span><span style="color: #0000BB">1</span><span style="color: #007700">)&nbsp;</span><span style="color: #0000BB">Weapon_SetSecondaryClip</span><span style="color: #007700">(</span><span style="color: #0000BB">iWeapon</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">iClip2</span><span style="color: #007700">+</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /><br /></span><span style="color: #FF8000">/**<br />&nbsp;*&nbsp;Called&nbsp;after&nbsp;select&nbsp;an&nbsp;extraitem&nbsp;in&nbsp;equipment&nbsp;menu.<br />&nbsp;*&nbsp;<br />&nbsp;*&nbsp;@param&nbsp;clientIndex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;index&nbsp;of&nbsp;the&nbsp;buyer.<br />&nbsp;*&nbsp;@param&nbsp;extraitemIndex&nbsp;&nbsp;&nbsp;&nbsp;Index&nbsp;of&nbsp;extraitem&nbsp;from&nbsp;ZP_RegisterExtraItem()&nbsp;native.<br />&nbsp;*/<br /></span><span style="color: #007700">public&nbsp;</span><span style="color: #0000BB">Action&nbsp;ZP_OnExtraBuyCommand</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;clientIndex</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">int&nbsp;extraitemIndex</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Verify&nbsp;that&nbsp;the&nbsp;client&nbsp;is&nbsp;connected&nbsp;and&nbsp;alive<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(!</span><span style="color: #0000BB">IsPlayerExist</span><span style="color: #007700">(</span><span style="color: #0000BB">clientIndex</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">Plugin_Handled</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Check&nbsp;our&nbsp;item&nbsp;index<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">extraitemIndex&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">iItem</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Return&nbsp;ammopacks<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if(</span><span style="color: #0000BB">ZP_IsPlayerZombie</span><span style="color: #007700">(</span><span style="color: #0000BB">clientIndex</span><span style="color: #007700">)&nbsp;||&nbsp;</span><span style="color: #0000BB">ZP_IsPlayerSurvivor</span><span style="color: #007700">(</span><span style="color: #0000BB">clientIndex</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">Plugin_Handled</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Set&nbsp;ammo<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">InfinityAmmo</span><span style="color: #007700">[</span><span style="color: #0000BB">clientIndex</span><span style="color: #007700">]&nbsp;=&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Allow&nbsp;buying<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">return&nbsp;</span><span style="color: #0000BB">Plugin_Continue</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #FF8000">//**********************************************<br />//*&nbsp;OTHER&nbsp;FUNCTIONS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<br />//**********************************************<br /><br />/**<br />&nbsp;*&nbsp;Called&nbsp;once&nbsp;a&nbsp;client&nbsp;is&nbsp;authorized&nbsp;and&nbsp;fully&nbsp;in-game,&nbsp;and&nbsp;<br />&nbsp;*&nbsp;after&nbsp;all&nbsp;post-connection&nbsp;authorizations&nbsp;have&nbsp;been&nbsp;performed.&nbsp;&nbsp;<br />&nbsp;*<br />&nbsp;*&nbsp;This&nbsp;callback&nbsp;is&nbsp;gauranteed&nbsp;to&nbsp;occur&nbsp;on&nbsp;all&nbsp;clients,&nbsp;and&nbsp;always&nbsp;<br />&nbsp;*&nbsp;after&nbsp;each&nbsp;OnClientPutInServer()&nbsp;call.<br />&nbsp;*&nbsp;<br />&nbsp;*&nbsp;@param&nbsp;clientIndex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;client&nbsp;index.&nbsp;<br />&nbsp;*/<br /></span><span style="color: #007700">public&nbsp;</span><span style="color: #0000BB">void&nbsp;OnClientPutInServer</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;clientIndex</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Reset&nbsp;ammo<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">InfinityAmmo</span><span style="color: #007700">[</span><span style="color: #0000BB">clientIndex</span><span style="color: #007700">]&nbsp;=&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #FF8000">/**<br />&nbsp;*&nbsp;Called&nbsp;when&nbsp;a&nbsp;client&nbsp;became&nbsp;a&nbsp;zombie.<br />&nbsp;*&nbsp;<br />&nbsp;*&nbsp;@param&nbsp;clientIndex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;client&nbsp;to&nbsp;infect.<br />&nbsp;*&nbsp;@param&nbsp;infectorIndex&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;attacker&nbsp;who&nbsp;did&nbsp;the&nbsp;infect.<br />&nbsp;*<br />&nbsp;*/<br /></span><span style="color: #007700">public&nbsp;</span><span style="color: #0000BB">void&nbsp;ZP_OnClientInfected</span><span style="color: #007700">(</span><span style="color: #0000BB">int&nbsp;clientIndex</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">int&nbsp;infectorIndex</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Reset&nbsp;ammo<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">InfinityAmmo</span><span style="color: #007700">[</span><span style="color: #0000BB">clientIndex</span><span style="color: #007700">]&nbsp;=&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />}&nbsp;
<br /></span><span style="color: #0000BB"></span>
</span>
</code><!-- php buffer end -->
</div>
</code>
<hr />
</div>
</div></div>
</div>
</div></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...include.zip</a>(69.5 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