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

ASW


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

Napisano 25.11.2016 21:36

<div><font size="7"><div align="center"><font color="Green"><b>ASW</b></font></div></font><br /><br /><b>Hello, this is my first plugin that I posted here in AlliedMods.<br />I'm a beginner on codding plugins. And this is a simple plugin that I made to post here :).<br />I hope you like it :). Thank you.<br /><br />You can use this plugin on any mod you want.</b><br /><br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">Code:</div>
<hr /><code style="margin:0px" dir="ltr" style="text-align:left">/*==================================================<br />&nbsp;Plugin ~Admin Spawn Weapons~ Made by: Neverminddw<br />====================================================<br /><br />========================================================================================&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />||&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; &nbsp; &nbsp; //&nbsp; &nbsp; &nbsp; ||<br />||&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; &nbsp; &nbsp; //&nbsp; &nbsp; &nbsp; ||<br />||&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; &nbsp; &nbsp; //&nbsp; &nbsp; &nbsp; &nbsp; ||<br />||&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 />||&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; \&nbsp; &nbsp; //&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ||<br />||&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; &nbsp; \&nbsp; //&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ||<br />||&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; &nbsp; &nbsp; ||<br />=======================================================================================*/<br /><br />#include &lt;amxmodx&gt;<br />#include &lt;cstrike&gt;<br />#include &lt;fun&gt;<br />#include &lt;hamsandwich&gt;<br /><br />#define PLUGIN &quot;Admin_Spawn_Weapons&quot;<br />#define VERSION &quot;1.0&quot;<br />#define AUTHOR &quot;Neverminddw&quot;<br /><br /><br />public plugin_init() {<br />&nbsp; &nbsp; &nbsp; &nbsp; register_plugin(PLUGIN, VERSION, AUTHOR)<br />&nbsp; &nbsp; &nbsp; &nbsp; RegisterHam(Ham_Spawn, &quot;player&quot;, &quot;GiveWeapons&quot;, 1);<br />}<br /><br />public GiveWeapons(id)<br />{<br />&nbsp; &nbsp; &nbsp; &nbsp; if (get_user_flags(id) &amp; ADMIN_KICK) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; new CsTeams:userTeam = cs_get_user_team(id)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (userTeam == CS_TEAM_T) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; give_item( id, &quot;weapon_ak47&quot; ) // Gives ak47<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; give_item( id, &quot;weapon_glock18&quot; ) // Gives glock18<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cs_set_user_bpammo(id, CSW_AK47, 100) // Sets ammount of ammo ( bullets )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cs_set_user_bpammo(id, CSW_GLOCK18, 120) // Sets ammount of ammo ( bullets )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; colorchat(id, &quot;!y[!gASW!y]: !tYou got !gAK47 !t&amp; !gGLOCK18!y!&quot;) // If player is T this message will be shown to them on chat box.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else if(userTeam == CS_TEAM_CT) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; give_item(id,&quot;weapon_m4a1&quot;) // Gives m4a1<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; give_item(id,&quot;weapon_usp&quot;) // Gives usp<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cs_set_user_bpammo(id, CSW_M4A1, 90) // Sets ammount of ammo ( bullets )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cs_set_user_bpammo(id, CSW_USP, 100) // Sets ammount of ammo ( bullets )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; colorchat(id, &quot;!y[!gASW!y]: !tYou got !gM4A1 !t&amp; !gUSP!y!&quot;) // If player is CT this message will be shown to them on chat box.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />}<br /><br />stock colorchat( const id, const input[], any: ... )<br />{<br />&nbsp; &nbsp; &nbsp; &nbsp; new count = 1, players[32], i, player;<br />&nbsp; &nbsp; &nbsp; &nbsp; static msg[191];<br />&nbsp; &nbsp; &nbsp; &nbsp; if ( numargs() == 2 )<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; copy( msg, 190, input );<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vformat( msg, 190, input, 3 );<br />&nbsp; &nbsp; &nbsp; &nbsp; replace_all( msg, 190, &quot;!g&quot;, &quot;^4&quot; );<br />&nbsp; &nbsp; &nbsp; &nbsp; replace_all( msg, 190, &quot;!y&quot;, &quot;^1&quot; );<br />&nbsp; &nbsp; &nbsp; &nbsp; replace_all( msg, 190, &quot;!t&quot;, &quot;^3&quot; );<br />&nbsp; &nbsp; &nbsp; &nbsp; if ( id )<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( !is_user_connected( id ) ) return;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; players[0] = id;<br />&nbsp; &nbsp; &nbsp; &nbsp; } else get_players( players, count, &quot;ch&quot; );<br />&nbsp; &nbsp; &nbsp; &nbsp; for ( i = 0; i &lt; count; i++ )<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; player = players[i];<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message_begin( MSG_ONE_UNRELIABLE, get_user_msgid( &quot;SayText&quot; ), _, player );<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; write_byte( player );<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; write_string( msg );<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; message_end();<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />}</code><hr />
</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/sma.gif" alt="File Type: sma" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>

<a href="http://www.amxmodx.o...12"><strong>Get Plugin</strong></a> or
<a href="https://forums.allie...1480106210">Get Source</a> (ASW.sma - 3.0 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