<!-- BEGIN TEMPLATE: postbit_external -->
<div><div align="center"><font size="4"><font color="Magenta"><i><b><u>The Custom Weapon Interface</u></b></i></font></font><font size="4"><br /></font></div> <br />After a day or so of coding I've created a pretty simple, cool and amazing interface for custom weapons.<br />It allows you to change weapon viewmodels and worldmodels.<br /><br />If you're using a custom weapon model. Make sure that you add the files to the downloads table like this:<br /><!-- BEGIN TEMPLATE: bbcode_code_printable -->
<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">public OnMapStart()<br />{<br /> AddFileToDownloadsTable(PATH OF FILE);<br />}</code><hr />
</div>
<!-- END TEMPLATE: bbcode_code_printable -->Remember to include the .vtx file extension with a few files. Many people get muddled up on this.<br /><br /> dx90.vtx<br /> dx80.vtx<br /> xbox.vtx<br /> sw.vtx<br /><br /><br />Natives:<br /><!-- BEGIN TEMPLATE: bbcode_code_printable -->
<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 /> * @brief Registers a custom Weapon and Returns it's index.<br /> *<br /> * @param String WeaponToReplace<br /> * @param String WeaponName<br /> * @return Integer WeaponID<br /> */<br />native WX_RegisterWeapon(const String:replace[], const String:name[]);<br /><br />/**<br /> * @brief Sets the weapons View/World Model.<br /> *<br /> * @param Integer WeaponID<br /> * @param String Path<br /> * @noreturn<br /> */<br />native WX_SetWeaponViewModel(WeaponID, const String:path[]);<br />native WX_SetWeaponWorldModel(WeaponID, const String:path[]);<br /><br />/**<br /> * @brief Returns Model Index.<br /> *<br /> * @param Integer WeaponID<br /> * @return Integer ModelIndex<br /> */<br />native WX_GetWeaponViewModel(WeaponID);<br />native WX_GetWeaponWorldModel(WeaponID);<br /><br />/**<br /> * @brief Gets Weapon Name by its ID.<br /> *<br /> * @param Integer The Ability<br /> * @param Integer WeaponID<br /> * @return String WeaponName<br /> */<br />native WX_GetWeaponName(Weapon, String:buffer[]);<br /><br />/**<br /> * @brief Returns how many registered weapons there are.<br /> *<br /> * @return Number of registered Weapons<br /> */<br />native WX_RegisteredWeapons();</code><hr />
</div>
<!-- END TEMPLATE: bbcode_code_printable -->Forwards:<br /><br /><!-- BEGIN TEMPLATE: bbcode_code_printable -->
<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 /> * @brief When a custom weapon has been given to the player<br /> *<br /> * @param Client A Player<br /> * @param Integer WeaponID<br /> * @noreturn<br /> */<br />forward WXF_OnWeaponGiven(Client, WeaponID);<br /><br />/**<br /> * @brief When a custom weapon has been removed from the player<br /> *<br /> * @param Client A Player<br /> * @param Integer WeaponID<br /> * @noreturn<br /> */<br />forward WXF_OnWeaponRemoved(Client, WeaponID);<br /><br />/**<br /> * @brief When a custom weapon has been fired.<br /> *<br /> * @param Client A Player<br /> * @param Integer WeaponID<br /> */<br />forward WXF_OnWeaponFired(Client, WeaponID);</code><hr />
</div>
<!-- END TEMPLATE: bbcode_code_printable -->Example Usage:<br /><!-- BEGIN TEMPLATE: bbcode_code_printable -->
<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">#pragma semicolon 1<br /><br />#include <sourcemod><br />#include <cstrike><br />#include <sdktools><br />#include <WeaponAPI><br /><br />public Plugin:myinfo=<br />{<br /> name="Weapon Interface Example",<br /> author="Skydive",<br /> description="Changes Many Weapons!",<br /> version="1.0",<br /> url=""<br />};<br /><br />new WeaponUMP;<br /><br />public OnPluginStart()<br />{<br /> WeaponUMP = WX_RegisterWeapon("weapon_ump45","UMP-->P90 And Burn");<br /> WX_SetWeaponViewModel(WeaponUMP,"models/Weapons/v_smg_p90.mdl");<br /> WX_SetWeaponWorldModel(WeaponUMP,"models/Weapons/w_smg_p90.mdl");<br /><br /> //Create Global Forwards<br /> StartWeaponForwards();<br />}<br /><br /><br />public WXF_OnWeaponDamaged(Client,WeaponID,Victim)<br />{<br /> //Check if the WeaponID is a UMP<br /> if(WeaponID == WeaponUMP)<br /> {<br /> //Ignite Victim<br /> IgniteEntity(Victim, 6.0);<br /> }<br /> PrintToServer("ON WEAPON DAMAGED %i",WeaponID);<br />}</code><hr />
</div>
<!-- END TEMPLATE: bbcode_code_printable -->The WeaponInterface Plugin in the Source is Necessary for this to function.<br />Compile it and add it in your "/plugins" folder too.<br />Link To Code:<br /><a href="https://weaponinterf...googlecode.com/" target="_blank">https://weaponinterf...googlecode.com/</a><br />or<br /><a href="https://weaponinterf...weaponinterface" target="_blank">https://weaponinterf...nterface</a><br /><br />Use an SVN client to download them.<br /><br />Special Thanks to bacardi who posted the Weapon View Model code for me to alter.<br /><br />Please leave appropriate feedback and suggestions, I've released this early. It's lacking many features.<br /><br />This plugin is still in development. Will be updated periodically. Keep A Look Out!</div>
<!-- END TEMPLATE: postbit_external -->
Wyświetl pełny artykuł
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.
|
Guest Message by DevFuse
[CSS] Custom Weapon Interface
Temat rozp. Adminek AMXX.PL, 06.05.2013 14:03
Brak odpowiedzi do tego tematu
Użytkownicy przeglądający ten temat: 0
0 użytkowników, 0 gości, 0 anonimowych