Raised This Month: $ Target: $400
 0% 

Hi, a bit of help, please.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
S1acker
Junior Member
Join Date: Aug 2007
Old 08-16-2007 , 11:13   Hi, a bit of help, please.
Reply With Quote #1

I would like to make a really simple plugin which does a few basic commands.

Essentially I want
sm_lo3 (live on 3 .cfg, exec lo3.cfg) /lo3
sm_rr (mp_restargame 1) /rr
sm_default ( default server settings, exec server.cfg ) /default
sm_match ( match settings, exec settings.cvar ) /match

If any one would help me get this done I would be very thankful. Oh, and one small thing, only admins with he Z flag can do it.

Thanks!
S1acker is offline
dubbeh
Senior Member
Join Date: Jul 2007
Old 08-16-2007 , 13:19   Re: Hi, a bit of help, please.
Reply With Quote #2

This might help - http://forums.alliedmods.net/showthread.php?p=504745

Just a warning that the ko3 currently has a problem with dancing knives

Recommend setting ygmsm_kniferoundstrip "0" to skip the weapon strip bug
__________________
SM Plugins - dubbeh.net - Plugin requests are welcome
dubbeh is offline
S1acker
Junior Member
Join Date: Aug 2007
Old 08-16-2007 , 22:38   Re: Hi, a bit of help, please.
Reply With Quote #3

Yeah, I've seen his but it has alot of extra stuff that I don't need. If someone can just give me enough code to get me started I'm sure I can finish it. (Y)
S1acker is offline
dubbeh
Senior Member
Join Date: Jul 2007
Old 08-17-2007 , 05:04   Re: Hi, a bit of help, please.
Reply With Quote #4

Easiest way i would recommend is look into RegAdminCmd.

Grab a small plugin i did using that from here and start hacking ;).
__________________
SM Plugins - dubbeh.net - Plugin requests are welcome
dubbeh is offline
S1acker
Junior Member
Join Date: Aug 2007
Old 08-17-2007 , 13:13   Re: Hi, a bit of help, please.
Reply With Quote #5

Hmm. I"ll wander through the source of YeGods Match Server Manager and try and figure it out.

Although a simple snippet would be helpful.

Edit, nvm, there's no source.
S1acker is offline
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 08-17-2007 , 13:32   Re: Hi, a bit of help, please.
Reply With Quote #6

What do you mean there's no source? All approved plugins have to have source code. If they don't, let me know so they can be unapproved.
__________________
I'm a blast from the past!
ferret is offline
S1acker
Junior Member
Join Date: Aug 2007
Old 08-17-2007 , 14:29   Re: Hi, a bit of help, please.
Reply With Quote #7

In the attached files bit I don't see the source link where it normally is.

http://forums.alliedmods.net/showthread.php?p=504745
S1acker is offline
ferret
SourceMod Developer
Join Date: Dec 2004
Location: Atlanta, GA
Old 08-17-2007 , 14:39   Re: Hi, a bit of help, please.
Reply With Quote #8

He uses a zip file to make installation easier. Download the zip and open it, it has the source file.
__________________
I'm a blast from the past!
ferret is offline
dubbeh
Senior Member
Join Date: Jul 2007
Old 08-17-2007 , 14:52   Re: Hi, a bit of help, please.
Reply With Quote #9

Source is included in the ygmsm_beta2.zip file

I'll code u up a quick example of creating a sm_lo3 command the easy way

PHP Code:
#include <sourcemod>

#pragma semicolon 1
#define PLUGIN_VERSION "1.0.0.0"

public Plugin:myinfo =
{
    
name "Run lo3.cfg",
    
author "dubbeh",
    
description "Execute a custom lo3.cfg script",
    
version PLUGIN_VERSION,
    
url "http://www.sourcemod.net/"
};

public 
OnPluginStart ()
{
    
/* register the sm_lo3 console command */
    
RegAdminCmd ("sm_lo3"RunLO3ScriptADMFLAG_RCON);
}

public 
Action:RunLO3Script (clientargs)
{
    if (
args == 0)
    {
        
ReplyToCommand (client"Running lo3.cfg")
        
ServerCommand ("exec lo3.cfg");
    }
    else
    {
        
ReplyToCommand (client"sm_lo3 invalid format");
        
ReplyToCommand (client"Usage: sm_lo3");
    }

    return 
Plugin_Handled;

Have fun ;)
__________________
SM Plugins - dubbeh.net - Plugin requests are welcome

Last edited by dubbeh; 08-17-2007 at 14:54.
dubbeh is offline
hazard
Member
Join Date: Jun 2007
Old 08-17-2007 , 14:52   Re: Hi, a bit of help, please.
Reply With Quote #10

just so i can exercise my brain and help a noob out

you're gonna do some RegAdminCmd's in your OnPluginStart like so:
Code:
 RegAdminCmd("sm_lo3", lo3, ADMFLAG_GENERIC, "pointless description");
replacing admflag_generic with whatever you say you need. You can find the flag list somewhere in admin.inc.



then make the corresponding function/action whatever (i dont know terminology) like so:

Code:
 public Action:lo3(client, args)
{
     ServerCommand("exec lo3.cfg");
}
[edit]
Yeah WHATEVER dubbeh!
hazard 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 10:32.


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