AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugin/Gameplay Ideas and Requests (https://forums.alliedmods.net/forumdisplay.php?f=60)
-   -   Deagle and AWP at the start of the round (https://forums.alliedmods.net/showthread.php?t=309124)

TrullSin 07-14-2018 11:01

Deagle and AWP at the start of the round
 
Is there a plugin to give AWP and Deagle at the start of the round?

iskenderkebab33 07-14-2018 11:20

Re: Deagle and AWP at the start of the round
 
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");



TrullSin 07-14-2018 11:24

Re: Deagle and AWP at the start of the round
 
But I would like a plugin so that I can desactivate and activate any time I want in the plugin

iskenderkebab33 07-14-2018 11:27

Re: Deagle and AWP at the start of the round
 
Quote:

Originally Posted by TrullSin (Post 2603559)
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 ?

TrullSin 07-14-2018 11:30

Re: Deagle and AWP at the start of the round
 
Yes

iskenderkebab33 07-14-2018 11:36

Re: Deagle and AWP at the start of the round
 
uhh, i don't understand the ConVar in SourcePawn, need also to learn it. maybe someone can help me and you out.

micapat 07-14-2018 11:41

Re: Deagle and AWP at the start of the round
 
https://wiki.alliedmods.net/ConVars_...Mod_Scripting)

mug1wara 07-14-2018 11:41

Re: Deagle and AWP at the start of the round
 
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

iskenderkebab33 07-14-2018 11:42

Re: Deagle and AWP at the start of the round
 
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");



mug1wara 07-14-2018 11:45

Re: Deagle and AWP at the start of the round
 
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


All times are GMT -4. The time now is 12:56.

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