Raised This Month: $32 Target: $400
 8% 

Deagle and AWP at the start of the round


Post New Thread Reply   
 
Thread Tools Display Modes
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 11:47   Re: Deagle and AWP at the start of the round
Reply With Quote #11

@mug1wara is my Code above correct? Can you give a look pls. thx

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

Quote:
Originally Posted by iskenderkebab33 View Post
!! no idear if this is correctly and working !! (some better Coder help)

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");

no, honey no....

let's start from the beginning (what's wrong with this code).

first of all, there's no client indexing, you can't do it in OnPluginStart (unless you loop through all players), neither can you have it in the function "HookEvent", since the arguments doesn't match the definition.

ough... same thing with the sdkhook, also the two first servercommands are incorrect

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

Quote:
Originally Posted by mug1wara View Post
no, honey no....
can you help me out please.
iskenderkebab33 is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 11:54   Re: Deagle and AWP at the start of the round
Reply With Quote #14

ohh maaann why SourcePawn need to be so hard, can you write an example pls.

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

PHP Code:
#include <sourcemod>

#pragma semicolon 1

ConVar g_cvWeapon;
ConVar g_cvSomeOtherCVar;

public 
void OnPluginStart()
{
    
g_cvWeapon FindConVar("mp_ct_default_primary \"weapon_awp\"");
    
    
g_cvSomeOtherCVar CreateConVar("sm_someothercvar""1");
    
    
HookEvent("round_start"Event_StartEventHookMode_Pre);
}

public 
Action Event_Start(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    if (
g_cvSomeOtherCVar.IntValue == 0)
    {
        for (
int i 1<= MaxClientsi++)
        {
            
SendConVarValue(ig_cvWeapon"\"\"");
        }
    }
    
    return 
Plugin_Continue;

mug1wara is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-14-2018 , 12:16   Re: Deagle and AWP at the start of the round
Reply With Quote #16

Quote:
Originally Posted by iskenderkebab33 View Post
ohh maaann why SourcePawn need to be so hard, can you write an example pls.
sourcepawn is like any other native language, if you know it it's easy. you have to practice if you want to achieve better.

I'm young*, so it's still quite easy to learn stuff xd

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

Quote:
Originally Posted by mug1wara View Post
PHP Code:
#include <sourcemod>

#pragma semicolon 1

ConVar g_cvWeapon;
ConVar g_cvSomeOtherCVar;

public 
void OnPluginStart()
{
    
g_cvWeapon FindConVar("mp_ct_default_primary \"weapon_awp\"");
    
    
g_cvSomeOtherCVar CreateConVar("sm_someothercvar""1");
    
    
HookEvent("round_start"Event_StartEventHookMode_Pre);
}

public 
Action Event_Start(Event hEvent, const char[] sNamebool bDontBroadcast)
{
    if (
g_cvSomeOtherCVar.IntValue == 0)
    {
        for (
int i 1<= MaxClientsi++)
        {
            
SendConVarValue(ig_cvWeapon"\"\"");
        }
    }
    
    return 
Plugin_Continue;

thanks, will look it through, one more question, how do you learn SourcePawn?
iskenderkebab33 is offline
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Old 07-14-2018 , 12:28   Re: Deagle and AWP at the start of the round
Reply With Quote #18

Study, I get a lot of help from people when I don't know something. Try learn to understand, rather than learn to remember.
mug1wara is offline
iskenderkebab33
Senior Member
Join Date: Jun 2018
Old 07-14-2018 , 12:32   Re: Deagle and AWP at the start of the round
Reply With Quote #19

Quote:
Originally Posted by mug1wara View Post
Study, I get a lot of help from people when I don't know something. Try learn to understand, rather than learn to remember.
okay thanks. will try it also.
iskenderkebab33 is offline
Reply


Thread Tools
Display Modes

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 01:33.


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