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

Request simple plugin, but too hard for me.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
TheReaperr
Junior Member
Join Date: Jun 2012
Old 02-16-2013 , 15:25   Request simple plugin, but too hard for me.
Reply With Quote #1

Hey

I want a plugin where if you type
/stealth

you will also do
/render @me 5
/cheat buddha

message only you get that you are in Stealth mode

and if you type it again

/render @me 0
/cheat buddha

message only you get that you are no longer in stealth mode


Yes I tried all the other godmode/invisibility plugins but the mod I'm trying to use it for doesn't support any of them, it just crashes the server.

Last edited by TheReaperr; 02-16-2013 at 16:12. Reason: fixed the commands
TheReaperr is offline
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 02-16-2013 , 21:08   Re: Request simple plugin, but too hard for me.
Reply With Quote #2

The following code is untested, but from what you have said, it should work. You are asking for something that makes someone do the command /cheat and /render; you have to have another plugin(s) that have the commands sm_cheat and sm_render.

PHP Code:
#include <sourcemod>

public OnPluginStart()
{
    
RegAdminCmd("sm_stealth"Command_StealthADMFLAG_GENERIC);
}

public 
Action:Command_Stealth(clientargs)
{
    new 
toggle;

    if(!
toggle)
    {
        
FakeClientCommand(client"sm_render @me 5");
        
FakeClientCommand(client"sm_cheat buddha");
        
PrintToChat(client"[SM] You are now in stealth mode.");
        
toggle 1;
    } else
    {
        
FakeClientCommand(client"sm_render @me 0");
        
FakeClientCOmmand(client"sm_cheat buddha");
        
PrintToChat(client"[SM] You are no longer in stealth mode.");
        
toggle 0;
    }
    return 
toggle;


Last edited by Marcus_Brown001; 02-16-2013 at 21:08.
Marcus_Brown001 is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 02-16-2013 , 23:14   Re: Request simple plugin, but too hard for me.
Reply With Quote #3

toggle will always be 0/false with that code.

You should use static toggle[MAXPLAYERS + 1]; instead, then check toggle[client] instead of toggle.
__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)
MasterOfTheXP is offline
TheReaperr
Junior Member
Join Date: Jun 2012
Old 02-17-2013 , 13:51   Re: Request simple plugin, but too hard for me.
Reply With Quote #4

@Marcus_Brown001
Yes I do have the other 2 plugins and want to combine those 2 in this script.

@MasterOfTheXP
I don't mind changing that myself, but I couldn't figure out what parts of the script should be replaced with what you were saying, could you perhaps be more specific/ fix it yourself?

Last edited by TheReaperr; 02-17-2013 at 13:53. Reason: Didn't want to doublepost.
TheReaperr is offline
MasterOfTheXP
Veteran Member
Join Date: Aug 2011
Location: Cloudbank
Old 02-17-2013 , 16:55   Re: Request simple plugin, but too hard for me.
Reply With Quote #5

PHP Code:
#include <sourcemod>

public OnPluginStart()
{
    
RegAdminCmd("sm_stealth"Command_StealthADMFLAG_GENERIC);
}

public 
Action:Command_Stealth(clientargs)
{
    static 
bool:toggle[MAXPLAYERS 1];

    if(!
toggle[client])
    {
        
FakeClientCommand(client"sm_render @me 5");
        
FakeClientCommand(client"sm_cheat buddha");
        
PrintToChat(client"[SM] You are now in stealth mode.");
    }
    else
    {
        
FakeClientCommand(client"sm_render @me 0");
        
FakeClientCOmmand(client"sm_cheat buddha");
        
PrintToChat(client"[SM] You are no longer in stealth mode.");
    }
    
toggle[client] = !toggle[client];
    return 
Plugin_Handled;

__________________
Plugins / My Steam / TF2 Sandbox (plugin beta testing!)

Last edited by MasterOfTheXP; 02-17-2013 at 17:25. Reason: Whoops >.>
MasterOfTheXP is offline
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 02-17-2013 , 20:13   Re: Request simple plugin, but too hard for me.
Reply With Quote #6

Yeah ... Was writing on laptop before I fell asleep. Thanks for the correction
Marcus_Brown001 is offline
TheReaperr
Junior Member
Join Date: Jun 2012
Old 02-22-2013 , 09:44   Re: Request simple plugin, but too hard for me.
Reply With Quote #7

Thanks a lot . Sorry I didn't respond very quickly... all the time, but I don't get notifications :\
TheReaperr 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 22:29.


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