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

Deagle and AWP at the start of the round


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TrullSin
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 11:01   Deagle and AWP at the start of the round
Reply With Quote #1

Is there a plugin to give AWP and Deagle at the start of the round?
TrullSin is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 11:20   Re: Deagle and AWP at the start of the round
Reply With Quote #2

Plugin not needed.
Code:
Deagle:
mp_ct_default_secondary weapon_deagle

mp_t_default_secondary weapon_deagle

AWP:
mp_ct_default primary weapon_awp

mp_t_default primary weapon_awp
or with Hook round_start

PHP Code:
#include <sourcemod>
#include <sdkhooks>

public void OnPluginStart()
{
    
HookEvent("round_start"Event_Start);
}

public 
Action Event_Start(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
ServerCommand("mp_ct_default primary weapon_awp");
    
ServerCommand("mp_t_default primary weapon_awp");
    
ServerCommand("mp_ct_default_secondary weapon_deagle");
    
ServerCommand("mp_t_default_secondary weapon_deagle");


Last edited by iskenderkebab33; 07-14-2018 at 11:24.
iskenderkebab33 is offline
TrullSin
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 11:24   Re: Deagle and AWP at the start of the round
Reply With Quote #3

But I would like a plugin so that I can desactivate and activate any time I want in the plugin
TrullSin is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 11:27   Re: Deagle and AWP at the start of the round
Reply With Quote #4

Quote:
Originally Posted by TrullSin View Post
But I would like a plugin so that I can desactivate and activate any time I want in the plugin
like, sm_awpdeagle 1/0 ?
iskenderkebab33 is offline
TrullSin
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 11:30   Re: Deagle and AWP at the start of the round
Reply With Quote #5

Yes
TrullSin is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 11:36   Re: Deagle and AWP at the start of the round
Reply With Quote #6

uhh, i don't understand the ConVar in SourcePawn, need also to learn it. maybe someone can help me and you out.
iskenderkebab33 is offline
micapat
Veteran Member
Join Date: Feb 2010
Location: Nyuu, nyuu (France).
Old 07-14-2018 , 11:41   Re: Deagle and AWP at the start of the round
Reply With Quote #7

https://wiki.alliedmods.net/ConVars_...Mod_Scripting)
__________________

Last edited by micapat; 07-14-2018 at 11:41.
micapat is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-14-2018 , 11:41   Re: Deagle and AWP at the start of the round
Reply With Quote #8

1st create a variable
PHP Code:
ConVar g_cvSomething
create the actual cvar, give it a name / default value
PHP Code:
g_cvSomething CreateConVar("name""valueGoesHere"); 
make a statement check in any of ur functions
PHP Code:
if (g_cvSomething.IntValue == 1
depending on what type of value is held (FloatValue, and so on)

profit
mug1wara is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 11:42   Re: Deagle and AWP at the start of the round
Reply With Quote #9

no idear if this is correctly and working

my try:

PHP Code:
#include <sourcemod>
#include <sdkhooks>

ConVar g_cvSomething;

public 
void OnPluginStart()
{
    
g_cvSomethingCreateConVar("sm_awpdeagle""1""Sets whether my plugin is enabled");
    
    
HookEvent("round_start"Event_Start);
}

public 
void Event_Start(int iClient)
{
    if (
g_cvSomething.IntValue == 1)
    {
        
SDKHook(iClientSDKHook_PostThinkCbk_OnPostThink);
    }
}

public 
Action Cbk_OnPostThink(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    
ServerCommand("mp_ct_default primary weapon_awp");
    
ServerCommand("mp_t_default primary weapon_awp");
    
ServerCommand("mp_ct_default_secondary weapon_deagle");
    
ServerCommand("mp_t_default_secondary weapon_deagle");


Last edited by iskenderkebab33; 08-02-2018 at 09:37.
iskenderkebab33 is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-14-2018 , 11:45   Re: Deagle and AWP at the start of the round
Reply With Quote #10

also why execute a cmd every fkn round, just throw that shit into server.cfg and if u are so desperate for a toggle then use FindConVar.... christ
mug1wara 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:14.


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