Raised This Month: $ Target: $400
 0% 

editing statsx.sma and /me command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ghostofmybrain
Veteran Member
Join Date: Mar 2010
Old 06-16-2010 , 16:46   editing statsx.sma and /me command
Reply With Quote #1

I'm interested in editting the statsx.sma file to make it so that if you say /me while alive, it returns "You must be dead to use this function", and if you say /me while dead it behaves normally.

I have absolutely no experience with this, but I think it would involve editting the public cmdMe (id) line to involve some sort of if alive, then this; if dead, then this. But I don't have the knowledge to actually add that myself.

Is anybody willing to help out?
ghostofmybrain is offline
tm.
Member
Join Date: Apr 2010
Old 06-16-2010 , 17:13   Re: editing statsx.sma and /me command
Reply With Quote #2

Replace
PHP Code:
public cmdMe(id)
{
    if (!
SayMe)
    {
        
client_print(idprint_chat"%L"id"DISABLED_MSG")
        return 
PLUGIN_HANDLED
    
}
    
    
format_kill_vinfo(id0g_sBuffer)
    
client_print(idprint_chat"* %s"g_sBuffer)
    
    return 
PLUGIN_CONTINUE

with
PHP Code:
public cmdMe(id)
{
    if (!
SayMe)
    {
        
client_print(idprint_chat"%L"id"DISABLED_MSG")
        return 
PLUGIN_HANDLED
    
}

    if (
is_user_alive(id))
    {
        
client_print(idprint_chat"You must be dead to use this function")
        return 
PLUGIN_HANDLED
    
}

    
format_kill_vinfo(id0g_sBuffer)
    
client_print(idprint_chat"* %s"g_sBuffer)
    
    return 
PLUGIN_CONTINUE

Or, if you wish to use the dictionary for multilingual and to keep the plugin's format:
PHP Code:
public cmdMe(id)
{
    if (!
SayMe)
    {
        
client_print(idprint_chat"%L"id"DISABLED_MSG")
        return 
PLUGIN_HANDLED
    
}

    if (
is_user_alive(id))
    {
        
client_print(idprint_chat"%L"id"ONLY_DEATH_ME")
        return 
PLUGIN_HANDLED
    
}

    
format_kill_vinfo(id0g_sBuffer)
    
client_print(idprint_chat"* %s"g_sBuffer)
    
    return 
PLUGIN_CONTINUE

afterwards add in data/lang/statsx.txt
Code:
ONLY_DEATH_ME = You must be dead to use this function

Last edited by tm.; 06-16-2010 at 17:22.
tm. is offline
ghostofmybrain
Veteran Member
Join Date: Mar 2010
Old 06-16-2010 , 17:21   Re: editing statsx.sma and /me command
Reply With Quote #3

Ohhh, ok, that's pretty simple actually. I understood everything you did. Thanks!

EDIT: I just tried that out, and it works perfectly. Thanks again!

Last edited by ghostofmybrain; 06-16-2010 at 18:25.
ghostofmybrain 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 14:53.


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