[TF2 + TF2Items + TF2Items GiveWeapon] How to make a custom gamemode
3 Attachment(s)
Hello, and today we will develop a plugin that modifies the inner game aspects for gameplay, also known as a gamemode.
With our gamemode, we will make one where you spawn as Pyro, and you get only one weapon. Requirements: -Sourcemod -TF2 -TF2Items -TF2Items GiveWeapon (plugin and .inc) Now lets get started! Includes (can be modified): Code:
#include <sourcemod> Now, to make our plugin. Code:
new TF2ItemSlot = 8; Code:
public Plugin:myinfo = Next you would need to hook the events, for this, I chose player_spawn and post_inventory_application. Code:
public OnPluginStart() Code:
public OnPostInventoryApplicationAndPlayerSpawn( Handle:hEvent, const String:strEventName[], bool:bDontBroadcast ) Code:
new iClient = GetClientOfUserId( GetEventInt( hEvent, "userid" ) ) Code:
for( new iSlot = 0; iSlot < _:TF2ItemSlot; iSlot++ ) Code:
TF2Items_GiveWeapon(iClient, 9990); Code:
TF2_RemoveWeaponSlot(iClient, 1); Code:
TF2_SetPlayerClass(iClient, TFClass_Pyro, false, true); Code:
#include <sourcemod> Code:
"custom_give_weapons_vlolz" You can edit this plugin to your liking, but DO NOT RELEASE THE PYROBATTLE PLUGIN TO NEW PLUGINS. Plugin and files included are below. |
Re: [TF2 + TF2Items + TF2Items GiveWeapon] How to make a custom gamemode
neat
|
Re: [TF2 + TF2Items + TF2Items GiveWeapon] How to make a custom gamemode
as longer as TF2Items GiveWeapon uses TF2ItemsInfo,
there's already TF2ItemSlot enum so you have to check for it Code:
#if !defined _tf2itemsinfo_included Code:
public OnAllPluginsLoaded() so plugin should look like: PHP Code:
oh any reason why it's a tf_weapon_syringegun_medic with item ID #527 (widowmaker)? |
Re: [TF2 + TF2Items + TF2Items GiveWeapon] How to make a custom gamemode
Quote:
|
Re: [TF2 + TF2Items + TF2Items GiveWeapon] How to make a custom gamemode
Quote:
|
Re: [TF2 + TF2Items + TF2Items GiveWeapon] How to make a custom gamemode
Quote:
|
Re: [TF2 + TF2Items + TF2Items GiveWeapon] How to make a custom gamemode
Why are you going through 8 slots? Aren't there only 4?
|
Re: [TF2 + TF2Items + TF2Items GiveWeapon] How to make a custom gamemode
primary
secondary melee spy watches / build pda disguise kit / destroy pda builder / head misc / misc2 action |
Re: [TF2 + TF2Items + TF2Items GiveWeapon] How to make a custom gamemode
Quote:
|
Re: [TF2 + TF2Items + TF2Items GiveWeapon] How to make a custom gamemode
Quote:
|
All times are GMT -4. The time now is 10:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.