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

/me to be auto executed on dead or if you don't die at round end


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
yOou Know Me
BANNED
Join Date: Oct 2009
Old 07-26-2012 , 04:30   /me to be auto executed on dead or if you don't die at round end
Reply With Quote #1

Hello can anyone make the command "/me" to be automatically executed when you die and if you don't die this round and you are alive to be executed at the round end, when the server says "Terrorist's/Ct's Win!" I have two plugins maybe they will be of some help. And i'm using Statsx_shell not the normal statsx plugin for CS if you can edit that too.


This plugin will execute "/me" at the end of the round:
Code:
#include <amxmodx> 

#define CALLFUNC_SUCCESS 1 

public plugin_init() 
{ 
register_plugin("Auto /me on round end","1.0","<VeCo>") 

register_logevent("LogEvent_RoundEnd",2,"1=Round_End") 
} 

public LogEvent_RoundEnd() 
{ 
static i_players[32],i_num, i,id 
get_players(i_players,i_num,"a") 

for(i=0;i<i_num;i++) 
{ 
id = i_players[i] 

if(callfunc_begin("cmdMe","statsx.amxx") != CALLFUNC_SUCCESS) 
{ 
set_fail_state("StatsX isn't loaded! Plugin paused.") 

break 
} 

callfunc_push_int(id) 
callfunc_end() 
} 
}
This plugin will execute the "/me" plugin at death:
Code:
#include <amxmodx> 

#define CALLFUNC_SUCCESS 1 

public plugin_init() 
{ 
register_plugin("Auto /me on death","1.0","<VeCo>") 

register_event("DeathMsg","Event_DeathMsg","a") 
} 

public Event_DeathMsg() 
{ 
static id 
id = read_data(2) 

if(callfunc_begin("cmdMe","statsx.amxx") != CALLFUNC_SUCCESS) 
{ 
set_fail_state("StatsX isn't loaded! Plugin paused.") 

return 
} 

callfunc_push_int(id) 
callfunc_end() 
}
yOou Know Me is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-26-2012 , 04:58   Re: /me to be auto executed on dead or if you don't die at round end
Reply With Quote #2

Edit the 2 first lines to fit your needs.

PHP Code:
#define PLUGIN_NAME_TO_CALL        "StatsX"
#define FUNCTION_TO_CALL                "cmdMe"

#include <amxmodx>

#define VERSION "0.0.1"
#define PLUGIN "Auto /me"

new g_iMaxPlayers
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )

new g_iStatsXPluginIdg_iStatsXcmdMeId

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")
}

public 
plugin_cfg()
{
    
g_iStatsXPluginId is_plugin_loadedPLUGIN_NAME_TO_CALL )
    if( 
g_iStatsXPluginId )
    {
        
g_iStatsXcmdMeId get_func_id(FUNCTION_TO_CALLg_iStatsXPluginId)

        
g_iMaxPlayers get_maxplayers()

        
register_event("DeathMsg""Event_DeathMsg""a")
        
register_logevent("Logevent_Round_End"2"1=Round_End")
    }
}

public 
Event_DeathMsg()
{
    new 
id read_data(2)
    if( 
IsPlayer(id) )
    {
        
callmeid )
    }
}

public 
Logevent_Round_End()
{
    new 
players[32], num
    get_players
(playersnum"ac")
    for(--
numnum>=0num--)
    {
        
callmeplayers[num] )
    }
}

callmeid )
{
    
callfunc_begin_i(g_iStatsXcmdMeIdg_iStatsXPluginId)
    
callfunc_push_int(id)
    
callfunc_end()

You can also use this :
PHP Code:
#include <amxmodx>

#define VERSION "0.0.1"
#define PLUGIN "Auto /me"

new g_iMaxPlayers
#define IsPlayer(%0)    ( 1 <= %0 <= g_iMaxPlayers )

public plugin_init()
{
    
register_plugin(PLUGINVERSION"ConnorMcLeod")

    
g_iMaxPlayers get_maxplayers()

    
register_event("DeathMsg""Event_DeathMsg""a")
    
register_logevent("Logevent_Round_End"2"1=Round_End")
}

public 
Event_DeathMsg()
{
    new 
id read_data(2)
    if( 
IsPlayer(id) )
    {
        
client_cmdid"say /me" )
    }
}

public 
Logevent_Round_End()
{
    new 
players[32], num
    get_players
(playersnum"ac")
    for(--
numnum>=0num--)
    {
        
client_cmdplayers[num], "say /me" )
    }

__________________
- tired and retired -

- my plugins -

Last edited by ConnorMcLeod; 07-26-2012 at 05:01.
ConnorMcLeod is offline
yOou Know Me
BANNED
Join Date: Oct 2009
Old 07-26-2012 , 05:50   Re: /me to be auto executed on dead or if you don't die at round end
Reply With Quote #3

There is one problem i have removed those two register_clcmd's so that the players can't call the function. I want it to be automatically called from the server and when i removed them your plugin stopped working.. so apparently your plugin is using them, can you make the plugin call the /me function by some other way i have used the second plugin that you gave me and he was working fine, there was just this problem..

register_clcmd("say /me", "cmdMe", 0, "- display current round stats (chat)")
register_clcmd("say_team /me", "cmdMe", 0, "- display current round stats (chat)")

Last edited by yOou Know Me; 07-26-2012 at 05:52.
yOou Know Me is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-26-2012 , 06:00   Re: /me to be auto executed on dead or if you don't die at round end
Reply With Quote #4

Use the 1st code then, not the 2nd one.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
yOou Know Me
BANNED
Join Date: Oct 2009
Old 07-26-2012 , 07:35   Re: /me to be auto executed on dead or if you don't die at round end
Reply With Quote #5

I tried it but it's not working.. how must i change this i have tried without changing it and i tried changing it like this:

#define PLUGIN_NAME_TO_CALL "Statsx_shell"

but it doesn't work... ?
yOou Know Me is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 07-26-2012 , 10:08   Re: /me to be auto executed on dead or if you don't die at round end
Reply With Quote #6

You should put the name of the plugin as it is defined in register_plugin(
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
yOou Know Me
BANNED
Join Date: Oct 2009
Old 07-26-2012 , 13:16   Re: /me to be auto executed on dead or if you don't die at round end
Reply With Quote #7

Yes it's working now, but when you die you have those two options:
Killed by nick etc
you hit killer etc
(And i want the option to be here, but now it's over those two options, what is changed in this plugin ?)
yOou Know Me 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 08:32.


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