Raised This Month: $51 Target: $400
 12% 

Game Player Equip Start Round dont lose weapons


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TrullSin
Senior Member
Join Date: Jun 2018
Old 08-19-2018 , 21:29   Game Player Equip Start Round dont lose weapons
Reply With Quote #1

Is it possible to make a fix of this so that in some maps you dont lose all your weapons with this?

PHP Code:
#pragma semicolon 1

#include <sourcemod>
#include <sdktools>
#include <sdkhooks>

#define PLUGIN_VERSION     "1.1.1"

public Plugin:myinfo = {
    
name "Game_Player_Equip Fix",
    
author "Mitch",
    
description "Fixes player stripping",
    
version PLUGIN_VERSION,
    
url "http://www.sourcemod.net/"
};

public 
OnPluginStart() {
    
CreateConVar("sm_game_player_equip_version"PLUGIN_VERSION"Game_Player_Equip Fix"FCVAR_PLUGIN|FCVAR_NOTIFY|FCVAR_DONTRECORD);
}

public 
OnEntityCreated(entity, const String:classname[]) {
    if(
StrEqual(classname"game_player_equip"false)){
        
SDKHook(entitySDKHook_SpawnHook_OnEntitySpawn);
    }
}
public 
Action:Hook_OnEntitySpawn(entity) {
    if(!(
GetEntProp(entityProp_Data"m_spawnflags")&1)) {
        
SetEntProp(entityProp_Data"m_spawnflags"GetEntProp(entityProp_Data"m_spawnflags")|2);
    }
    return 
Plugin_Continue;

TrullSin is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 08-20-2018 , 18:56   Re: Game Player Equip Start Round dont lose weapons
Reply With Quote #2

There is already a fix...

https://forums.alliedmods.net/showthread.php?t=279263
__________________
Neuro Toxin is offline
TrullSin
Senior Member
Join Date: Jun 2018
Old 08-20-2018 , 20:20   Re: Game Player Equip Start Round dont lose weapons
Reply With Quote #3

But in some maps with that fix you lose all weapons at round start..
TrullSin is offline
Ilusion9
Veteran Member
Join Date: Jun 2018
Location: Romania
Old 08-21-2018 , 06:54   Re: Game Player Equip Start Round dont lose weapons
Reply With Quote #4

PHP Code:

#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

public void OnEntityCreated(int entity, const char[] classname)
{
    if(
StrEqual(classname"game_player_equip"))
    {
        
SDKHook(entitySDKHook_SpawnSpawn_GamePlayerEquip);
    }
}

public 
Action Spawn_GamePlayerEquip(int entity)
{
    if(!(
GetEntProp(entityProp_Data"m_spawnflags") & 1))
    {
        
SetEntProp(entityProp_Data"m_spawnflags"0); // if you set to 1, this entity will not be called on round start. 0 - all players receive weapons on round start from this entity, but no weapon will pe stripped (if they have a weapon, will be dropped on the ground).
    
}

Flags:
1 : Use Only
2 : Strip All Weapons First
4 : Only Strip Same Weapon Type

Be more explicit what do you want from this entity. Only to remove the weapon strip?

Last edited by Ilusion9; 08-21-2018 at 08:51.
Ilusion9 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:40.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode