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

Grenade


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wacci
AlliedModders Donor
Join Date: May 2017
Location: Hungary
Old 08-26-2017 , 11:33   Grenade
Reply With Quote #1

I would like to ask for a plugin,what is actually gives grenades at the start of the round,and I can change it by flag.

I can give a case key for the plugin's creator.
Wacci is offline
DarkBlackOMG
Member
Join Date: Oct 2015
Old 08-26-2017 , 12:19   Re: Grenade
Reply With Quote #2

Add me, i can help you http://steamcommunity.com/id/darkblackomg/
DarkBlackOMG is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 08-26-2017 , 12:33   Re: Grenade
Reply With Quote #3

Quote:
Originally Posted by Wacci View Post
I would like to ask for a plugin,what is actually gives grenades at the start of the round,and I can change it by flag.

I can give a case key for the plugin's creator.
don't pay for something so basic!

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

#pragma semicolon 1
#pragma newdecls required

ConVar gc_bPlugin;

public 
Plugin myinfo = {
    
name "VIP HE on Spawn",
    
author "shanapu",
    
description "give HE on spawn for vip",
    
version "0.1",
    
url ""
};

public 
void OnPluginStart()
{
    
gc_bPlugin CreateConVar("sm_spawn_he_enable""1""0 - disabled, 1 - enable plugin");
    
    
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
Action Event_PlayerSpawn(Handle eventchar[] namebool dontBroadcast)
{
    if(
gc_bPlugin.BoolValue)
    {
        
int client GetClientOfUserId(GetEventInt(event"userid"));
        if (
CheckCommandAccess(client"he_flag"ADMFLAG_RESERVATIONtrue)) 
        {
            
GivePlayerItem(client"weapon_hegrenade");
        }
    }

It's ADMFLAG_RESERVATION or command overwrite "he_flag"
__________________
coding & free software

Last edited by shanapu; 08-26-2017 at 12:34.
shanapu is offline
Wacci
AlliedModders Donor
Join Date: May 2017
Location: Hungary
Old 08-26-2017 , 12:43   Re: Grenade
Reply With Quote #4

thx, but i would like give inc or molotov, smoke and flash too.

can you give trade url ?
Wacci is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 08-26-2017 , 20:10   Re: Grenade
Reply With Quote #5

Quote:
Originally Posted by Wacci View Post
thx, but i would like give inc or molotov, smoke and flash too.
I'm pretty sure you can do it yourself!

just insert this:
PHP Code:
            GivePlayerItem(client"weapon_smokegrenade");
            
GivePlayerItem(client"weapon_flashbang"); 
behind
PHP Code:
            GivePlayerItem(client"weapon_hegrenade"); 
for smoke & flash.

And to check if the client is CT/T to give him a inc or molotov we also add this behind the part above:
PHP Code:
            if (GetClientTeam(client) == CS_TEAM_CT)
            {
                
GivePlayerItem(client"weapon_incgrenade");
            }
            else
            {
                
GivePlayerItem(client"weapon_molotov");
            } 
I hope you learned something with this post.

Quote:
Originally Posted by Wacci View Post
can you give trade url ?
Thanks, but I don't need keys or such csgo stuff. maybe donate someday to alliedmodders ;)
__________________
coding & free software

Last edited by shanapu; 08-26-2017 at 20:10.
shanapu is offline
Wacci
AlliedModders Donor
Join Date: May 2017
Location: Hungary
Old 08-27-2017 , 06:13   Re: Grenade
Reply With Quote #6

Quote:
Originally Posted by shanapu View Post
I'm pretty sure you can do it yourself!

just insert this:
PHP Code:
            GivePlayerItem(client"weapon_smokegrenade");
            
GivePlayerItem(client"weapon_flashbang"); 
behind
PHP Code:
            GivePlayerItem(client"weapon_hegrenade"); 
for smoke & flash.
I tried this before I wrote here, but I got a warning.

// D:\csgo\scripting\vip_grenade.sp(32) : warning 217: loose indentation



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

#pragma semicolon 1
#pragma newdecls required

ConVar gc_bPlugin;

public 
Plugin myinfo = {
    
name "VIP Grenades on Spawn",
    
author "shanapu",
    
description "give grenades on spawn for vip",
    
version "0.2",
    
url "https://forums.alliedmods.net/showthread.php?t=300699"
};

public 
void OnPluginStart()
{
    
gc_bPlugin CreateConVar("sm_spawn_he_enable""1""0 - disabled, 1 - enable plugin");
    
    
HookEvent("player_spawn"Event_PlayerSpawn);
}

public 
Action Event_PlayerSpawn(Handle eventchar[] namebool dontBroadcast)
{
    if(
gc_bPlugin.BoolValue)
    {
        
int client GetClientOfUserId(GetEventInt(event"userid"));
        if (
CheckCommandAccess(client"grenade_flag"ADMFLAG_CUSTOM6true)) 
        {
            
GivePlayerItem(client"weapon_hegrenade");
            
GivePlayerItem(client"weapon_smokegrenade");
            
GivePlayerItem(client"weapon_flashbang");
            if (
GetClientTeam(client) == CS_TEAM_CT)
                {
                    
GivePlayerItem(client"weapon_incgrenade");
                }
                else
                {
                    
GivePlayerItem(client"weapon_molotov");
                }  
        }
    }


//// vip_grenade.sp
//
// D:\csgo\scripting\vip_grenade.sp(32) : warning 217: loose indentation
// D:\csgo\scripting\vip_grenade.sp(34) : error 017: undefined symbol "CS_TEAM_CT"
//
// 1 Error.
//
// Compilation Time: 0,52 sec
// ----------------------------------------

Press enter to exit ..

1 Error and 1 Warning.
Wacci is offline
Vaggelis
Senior Member
Join Date: May 2017
Old 08-27-2017 , 07:17   Re: Grenade
Reply With Quote #7

Download this
Attached Files
File Type: sp Get Plugin or Get Source (vip_grenade.sp - 186 views - 1.1 KB)
Vaggelis is offline
Wacci
AlliedModders Donor
Join Date: May 2017
Location: Hungary
Old 08-27-2017 , 07:39   Re: Grenade
Reply With Quote #8

Very big thanks guys!
Wacci 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 22:06.


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