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

CS:GO mp_ct_default / mp_t_default not working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Astinox
Junior Member
Join Date: Mar 2016
Old 07-26-2016 , 14:52   CS:GO mp_ct_default / mp_t_default not working
Reply With Quote #1

//E: Sorry for double post, didn't notice there was an extra forum for scripting support!

Hey guys!
I am currently developing a small mod and I am stuck at a certain point. I try to give each team a different set of weapons. When I looked through the forums I found this post:

https://forums.alliedmods.net/showthread.php?t=209850

What I've done:
1.) Tested this code on de_dust2:
PHP Code:
mp_ct_default_grenades "weapon_flashbang weapon_smokegrenade weapon_decoygrenade"
mp_ct_default_melee weapon_knife
mp_ct_default_primary 
""
mp_ct_default_secondary weapon_fiveseven

mp_t_default_grenades 
"weapon_flashbang weapon_smokegrenade weapon_decoygrenade"
mp_ct_default_melee weapon_knife
mp_ct_default_primary 
""
mp_ct_default_secondary "" 
What I get is a CT without anything (just a knife) and a T with a glock. Which was stupid.

2.) Read the topic and saw there is a solution, tried to integrate it with the new standards
PHP Code:
#include <sourcemod>
#include <sdkhooks>
#include <sdktools>

public OnEntityCreated(entity, const char[] classname)
{
    if(
StrEqual(classname"game_player_equip"))
    {
        
AcceptEntityInput(entity"Kill");
    }

This does not work either. Still the same result on de_dust2, vanille sourcemod stuff without any extensions than the default.

Does anyone know a solution for this?

Cheers

P.S: I've also checked if the ConVar is set correctly on the server checking it via console, it has the correct value.
Astinox is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 07-26-2016 , 16:36   Re: CS:GO mp_ct_default / mp_t_default not working
Reply With Quote #2

You can't kill an entity that hasn't spawned yet, however you can just easily hook it's spawn with sdkhooks and just return Plugin_Stop to prevent it from being created.
other than that, it'd probably be best to just write a plugin that does this, as it would be more reliable.

Last edited by Mitchell; 07-26-2016 at 16:38.
Mitchell is offline
Astinox
Junior Member
Join Date: Mar 2016
Old 07-26-2016 , 16:41   Re: CS:GO mp_ct_default / mp_t_default not working
Reply With Quote #3

Isn't OnEntityCreated the function to check for spawned ones?
Astinox is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 07-26-2016 , 17:01   Re: CS:GO mp_ct_default / mp_t_default not working
Reply With Quote #4

Since we're double posting anyways, not sure what thread will be trashed.
All you need to do is set it the values properly.
You don't put mp_ct_default_secondary weapon_fiveseven and then mp_ct_default_secondary ""; otherwise, you will just be resetting the value back to nothing.
PHP Code:
mp_ct_default_grenades "weapon_flashbang weapon_smokegrenade weapon_decoygrenade"
mp_ct_default_melee "weapon_knife"
mp_ct_default_primary ""
mp_ct_default_secondary "weapon_fiveseven"

mp_t_default_grenades "weapon_flashbang weapon_smokegrenade weapon_decoygrenade"
mp_t_default_melee "weapon_knife"
mp_t_default_primary ""
mp_t_default_secondary "" 
Place it in your gamemode_casual_server.cfg or gamemode_competitive_server.cfg (which ever gamemode you use)
You don't need any SourceMod plugin to fix this, just properly set values in the right cfg file.
As you can see, it does work: http://puu.sh/qfrtz/941d87532a.png
Maxximou5 is offline
Astinox
Junior Member
Join Date: Mar 2016
Old 07-26-2016 , 17:15   Re: CS:GO mp_ct_default / mp_t_default not working
Reply With Quote #5

Oh shit thanks Maxximou5, sometimes you just oversee the easy things... Damn this. Thanks.
Astinox is offline
Maxximou5
AlliedModders Donor
Join Date: Feb 2013
Old 07-26-2016 , 17:35   Re: CS:GO mp_ct_default / mp_t_default not working
Reply With Quote #6

No worries, glad to hear it is that simple. It's when the simple fixes don't work... lol.
Maxximou5 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 20:27.


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