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

Help me create a plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
trikolino
Junior Member
Join Date: May 2013
Old 05-19-2013 , 10:55   Help me create a plugin
Reply With Quote #1

good friends, I really need your help to create a plugin to use in my server (map surf_ski_2).
I need a plugin that kills the player when playing any bombs (flash, HE) at the base

I do not know where to start .. If you can send me the plugin sma, will be grateful.
trikolino is offline
ironskillz1
AlliedModders Donor
Join Date: Jul 2012
Location: Sweden
Old 05-19-2013 , 11:41   Re: Help me create a plugin
Reply With Quote #2

Quote:
Originally Posted by trikolino View Post
good friends, I really need your help to create a plugin to use in my server (map surf_ski_2).
I need a plugin that kills the player when playing any bombs (flash, HE) at the base

I do not know where to start .. If you can send me the plugin sma, will be grateful.


Do you mean that when you throw a he grenade on someone he will die?
__________________
I have many private and unique plugins for Jailbreak and Hide'N'Seek. PM me for more info.

Pm me.

Check out my roulette site.
ironskillz1 is offline
Send a message via Skype™ to ironskillz1
trikolino
Junior Member
Join Date: May 2013
Old 05-19-2013 , 12:29   Re: Help me create a plugin
Reply With Quote #3

I am using a translator. I do not know if I understand well .. But anyway, I need a plugin that kills or a slap on the player who throws a Flash or HE base.
trikolino is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 05-20-2013 , 05:00   Re: Help me create a plugin
Reply With Quote #4

Try:
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <fakemeta>

new const g_nadeclasses[][] = {
    
"weapon_hegrenade",
    
"weapon_flashbang"
};

public 
plugin_init(){
    
register_plugin("Block nade throw","1.0","Hyuna");

    for (new 
isizeof g_nadeclasses;i++)
        
RegisterHam(Ham_Weapon_PrimaryAttack,g_nadeclasses[i],"fw_OnNadeThrow");
}

public 
fw_OnNadeThrow(ent){
    new 
client pev(ent,pev_owner);

    if (
is_user_alive(client))
        
user_kill(client,1);

    return 
HAM_SUPERCEDE;

__________________

Last edited by simanovich; 05-20-2013 at 05:00.
simanovich is offline
trikolino
Junior Member
Join Date: May 2013
Old 05-20-2013 , 17:48   Re: Help me create a plugin
Reply With Quote #5

Friend, that's what I wanted, but I needed the plugin with a time limit of 10 seconds. And with a warning to anyone who tried to bomb hit it
trikolino is offline
Old 05-20-2013, 17:57
trikolino
This message has been deleted by YamiKaitou. Reason: duplicate
Old 05-20-2013, 18:02
trikolino
This message has been deleted by YamiKaitou. Reason: duplicate
Old 05-21-2013, 00:52
wickedd
This message has been deleted by YamiKaitou. Reason: reply to deleted posts
Moody92
Veteran Member
Join Date: May 2011
Location: Oman
Old 05-21-2013 , 04:23   Re: Help me create a plugin
Reply With Quote #6

What ?? your translator sucks.

Check the multi-language forum and post in your own language.
Moody92 is offline
v3x
Veteran Member
Join Date: Oct 2004
Location: US
Old 05-21-2013 , 08:39   Re: Help me create a plugin
Reply With Quote #7

from my understanding:

he wants a plugin, for surf_ski_2, that slays/slaps anyone trying to throw a grenade of any type at the ct/t base within the first 10 seconds of a round. he also wants a warning for it.
__________________
What am I doing these days? Well, I run my own Rust server. It's heavily modded. If you'd like to join, the ip is 167.114.101.67:28116

I also created a website called Rust Tools. It will calculate and tell you the raw amounts of resources needed to craft items.
v3x is offline
Old 05-21-2013, 10:19
PoLiCe
This message has been deleted by YamiKaitou. Reason: reply to deleted post
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-21-2013 , 11:02   Re: Help me create a plugin
Reply With Quote #8

Here you go. Requires Orpheu Module aswell as the CGrenade signatures that I've attached below the .sma :
Code:
#include <amxmodx> #include <engine> #include <orpheu> #define RADIUS    200.0 #define TIMELIMIT   10.0 new Float:g_flRoundStart; public plugin_init() {     register_plugin( "No Nading Player Spawn!", "0.0.1", "hornet" );         new szMap[ 32 ];     get_mapname( szMap, charsmax( szMap ) );         if( equal( szMap, "surf_ski_2" ) )     {         OrpheuRegisterHook( OrpheuGetFunction( "Detonate3", "CGrenade" ), "CGrenade_Detonate" );         OrpheuRegisterHook( OrpheuGetFunction( "Detonate", "CGrenade" ), "CGrenade_Detonate" );         OrpheuRegisterHook( OrpheuGetFunction( "SG_Detonate", "CGrenade" ), "CGrenade_Detonate" );                 register_logevent( "LogEvent_RoundStart", 2, "1=Round_Start" );     } } public OrpheuHookReturn:CGrenade_Detonate( iEnt ) {     if( get_roundtime( g_flRoundStart ) > TIMELIMIT )         return OrpheuIgnored;         new iOwner = entity_get_edict( iEnt, EV_ENT_owner );         if( !is_user_alive( iOwner ) )         return OrpheuIgnored;         new Float:flOrigin[ 3 ];     entity_get_vector( iEnt, EV_VEC_origin, flOrigin );         new szSpawnEnt[ 32 ], Ents[ 1 ];         switch( get_user_team( iOwner ) )     {         case 1: szSpawnEnt = "info_player_start";         case 2: szSpawnEnt = "info_player_deathmatch";     }         if( find_sphere_class( iEnt, szSpawnEnt, RADIUS, Ents, 1, flOrigin ) )     {         user_kill( iOwner, 1 );                 new szName[ 32 ];         get_user_name( iOwner, szName, charsmax( szName ) );                 client_print( 0, print_chat, "[ AMXX ] Player %s was killed for throwing grenades into player spawn!", szName );     }         return OrpheuIgnored; } public LogEvent_RoundStart() {     g_flRoundStart = get_gametime(); } Float:get_roundtime( Float:flStart ) {     return get_gametime() - flStart; }
Attached Files
File Type: zip CGrenade.zip (1.1 KB, 53 views)
File Type: sma Get Plugin or Get Source (test5.sma - 111 views - 1.7 KB)
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 05-21-2013 at 11:46.
hornet is offline
trikolino
Junior Member
Join Date: May 2013
Old 05-21-2013 , 11:19   Re: Help me create a plugin
Reply With Quote #9

Quote:
Originally Posted by v3x View Post
from my understanding:

he wants a plugin, for surf_ski_2, that slays/slaps anyone trying to throw a grenade of any type at the ct/t base within the first 10 seconds of a round. he also wants a warning for it.
yes, exactly
trikolino is offline
trikolino
Junior Member
Join Date: May 2013
Old 05-21-2013 , 11:51   Re: Help me create a plugin
Reply With Quote #10

Quote:
Originally Posted by hornet View Post
Here you go. Requires Orpheu Module aswell as the CGrenade signatures that I've attached below the .sma :
Code:
#include <amxmodx> #include <engine> #include <orpheu> #define RADIUS    200.0 #define TIMELIMIT   10.0 new Float:g_flRoundStart; public plugin_init() {     register_plugin( "No Nading Player Spawn!", "0.0.1", "hornet" );         new szMap[ 32 ];     get_mapname( szMap, charsmax( szMap ) );         if( equal( szMap, "surf_ski_2" ) )     {         OrpheuRegisterHook( OrpheuGetFunction( "Detonate3", "CGrenade" ), "CGrenade_Detonate" );         OrpheuRegisterHook( OrpheuGetFunction( "Detonate", "CGrenade" ), "CGrenade_Detonate" );         OrpheuRegisterHook( OrpheuGetFunction( "SG_Detonate", "CGrenade" ), "CGrenade_Detonate" );                 register_logevent( "LogEvent_RoundStart", 2, "1=Round_Start" );     } } public OrpheuHookReturn:CGrenade_Detonate( iEnt ) {     if( get_roundtime( g_flRoundStart ) > TIMELIMIT )         return OrpheuIgnored;         new iOwner = entity_get_edict( iEnt, EV_ENT_owner );         if( !is_user_alive( iOwner ) )         return OrpheuIgnored;         new Float:flOrigin[ 3 ];     entity_get_vector( iEnt, EV_VEC_origin, flOrigin );         new szSpawnEnt[ 32 ], Ents[ 1 ];         switch( get_user_team( iOwner ) )     {         case 1: szSpawnEnt = "info_player_start";         case 2: szSpawnEnt = "info_player_deathmatch";     }         if( find_sphere_class( iEnt, szSpawnEnt, RADIUS, Ents, 1, flOrigin ) )     {         user_kill( iOwner, 1 );                 new szName[ 32 ];         get_user_name( iOwner, szName, charsmax( szName ) );                 client_print( 0, print_chat, "[ AMXX ] Player %s was killed for throwing grenades into player spawn!", szName );     }         return OrpheuIgnored; } public LogEvent_RoundStart() {     g_flRoundStart = get_gametime(); } Float:get_roundtime( Float:flStart ) {     return get_gametime() - flStart; }
friend must kill / beat anyone who tries to throw a grenade of any kind on the basis ct / t in the first 10 seconds of a round. and I also want a warning to him.
trikolino 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 09:23.


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