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

amx plugin to sourcemod


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DezzY
SourceMod Donor
Join Date: Apr 2012
Location: Portugal
Old 06-15-2014 , 10:20   amx plugin to sourcemod
Reply With Quote #1

Hello guys

I have this plugin for amxmodx.

Is possible to change the parameters of the plugin to work in sourcemod (CS:GO)

The working of the plugin is to in the game i say .rr and the plugin detect i'm a admin in the server execute the rr.cfg, in the rr.cfg have the comand to restart de server etc...

Tanks to all

Regards

HTML Code:
#include <amxmodx>
#include <amxmisc>
#define PLUGIN "Comandos"
#define VERSION "1.0"
#define AUTHOR "DezzY"

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say .rr", "RestartRound", ADMIN_IMMUNITY)
register_clcmd("say .ffon", "FFON", ADMIN_IMMUNITY)
register_clcmd("say .ffoff", "FFOFF", ADMIN_IMMUNITY)
register_clcmd("say .ftboff", "FTBOFF", ADMIN_IMMUNITY)
register_clcmd("say .ftbon", "FTBON", ADMIN_IMMUNITY)
register_clcmd("say .talkon", "TALKON", ADMIN_IMMUNITY)
register_clcmd("say .talkoff", "TALKOFF", ADMIN_IMMUNITY)
register_clcmd("say *rehash", "REHASH", ADMIN_IMMUNITY)
register_clcmd("say .cfg", "CFG", ADMIN_IMMUNITY)
register_clcmd("say .warmup", "WARMUP", ADMIN_IMMUNITY)
}

public RestartRound(id)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
server_cmd( "exec rr.cfg" )
}
}

public FFON(id)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
server_cmd( "exec ffon.cfg" )
}
}

public FFOFF(id)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
server_cmd( "exec ffoff.cfg" )
}
}

public FTBON(id)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
server_cmd( "exec ftbon.cfg" )
}
}

public FTBOFF(id)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
server_cmd( "exec ftboff.cfg" )
}
}

public TALKON(id)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
server_cmd( "exec talkon.cfg" )
}
}

public TALKOFF(id)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
server_cmd( "exec talkoff.cfg" )
}
}

public REHASH(id)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
server_cmd( "exec rehash.cfg" )
}
}

public CFG(id)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
server_cmd( "exec cfg.cfg" )
}
}

public WARMUP(id)
{
if (get_user_flags(id) & ADMIN_IMMUNITY)
{
server_cmd( "exec cwarmup.cfg" )
}
}
__________________

Last edited by DezzY; 06-15-2014 at 10:21.
DezzY is offline
Sillium
AlliedModders Donor
Join Date: Sep 2008
Location: Germany
Old 06-16-2014 , 01:15   Re: amx plugin to sourcemod
Reply With Quote #2

You could just add the cfg to adminmenu_cfgs.txt or adminmenu_custom.txt
https://wiki.alliedmods.net/Custom_A...28SourceMod%29
__________________
brb, dishes have developed their own language and are talking to the garbage about overthrowing me... i must correct this

www.unterwasserpyromanen.de
Sillium is offline
DezzY
SourceMod Donor
Join Date: Apr 2012
Location: Portugal
Old 06-18-2014 , 16:50   Re: amx plugin to sourcemod
Reply With Quote #3

Tanks for your reply!

That i know but what i really want is the plugin.

In the game in the chat i say ex:

.rr

and the server/plugin detect i'm admin and execute the comand to restart!

is more fast and easy...

In amxmodx it works but sourcemod i dont understand !

Tanks anyway for your reply
__________________
DezzY is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 06-18-2014 , 19:49   Re: amx plugin to sourcemod
Reply With Quote #4

Code:
#include <sourcemod>

public Plugin:myinfo =
{
	name = "Plugin",
	author = "Author",
	description = "Fuck the police.",
	version = "1.0.0",
	url = "http://www.sourcemod.net/"
};

public OnPluginStart()
{
	RegAdminCmd(".rr", RestartRound, ADMFLAG_GENERIC);
	RegAdminCmd(".ffon", FFON, ADMFLAG_GENERIC);
	RegAdminCmd(".ffoff", FFOFF, ADMFLAG_GENERIC);
	RegAdminCmd(".ftboff", FTBOFF, ADMFLAG_GENERIC);
	RegAdminCmd(".ftbon", FTBON, ADMFLAG_GENERIC);
	RegAdminCmd(".talkon", TALKON, ADMFLAG_GENERIC);
	RegAdminCmd(".talkoff", TALKOFF, ADMFLAG_GENERIC);
	RegAdminCmd("*rehash", REHASH, ADMFLAG_GENERIC);
	RegAdminCmd(".cfg", "CFG, ADMFLAG_GENERIC);
	RegAdminCmd(".warmup", WARMUP, ADMFLAG_GENERIC);
}

public Action:RestartRound(client, args)
{
	ServerCommand( "exec rr.cfg" );
}

public Action:FFON(client, args)
{
	ServerCommand( "exec ffon.cfg" );
}

public Action:FFOFF(client, args)
{
	ServerCommand( "exec ffoff.cfg" );
}

public Action:FTBON(client, args)
{
	ServerCommand( "exec ftbon.cfg" );
}

public Action:FTBOFF(client, args)
{
	ServerCommand( "exec ftboff.cfg" );
}

public Action:TALKON(client, args)
{
	ServerCommand( "exec talkon.cfg" );
}

public Action:TALKOFF(client, args)
{
	ServerCommand( "exec talkoff.cfg" );
}

public Action:REHASH(client, args)
{
	ServerCommand( "exec rehash.cfg" );
}

public Action:CFG(client, args)
{
	ServerCommand( "exec cfg.cfg" );
}

public Action:WARMUP(client, args)
{
	ServerCommand( "exec cwarmup.cfg" );
}
Merry Christmas. Didn't compile it.

Last edited by Drixevel; 06-18-2014 at 19:51.
Drixevel is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-19-2014 , 11:18   Re: amx plugin to sourcemod
Reply With Quote #5

Does it have to be .rr instead of /rr ?

SourceMod uses / and ! for its chat commands by default and commands registered using RegCmd and RegAdminCmd will automatically register chat commands for their / and ! versions.

For example, this will register the /rr and !rr commands for users with the generic admin flag (b):

PHP Code:
public Plugin:myinfo = {
    
name            "Comandos",
    
author            "DezzY",
    
description        "",
    
version            "1.0",
    
url                ""
};

public 
OnPluginStart()
{
    
RegAdminCmd("rr"RestartRoundADMFLAG_GENERIC);
}

public 
Action:RestartRound(clientargs)
{
    
ServerCommand("exec rr.cfg");
    return 
Plugin_Handled;

Edit: Note that / and ! can be changed via SourceMod's addons/sourcemod/configs/core.cfg to other characters, but this change is server-wide.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 06-19-2014 at 11:21.
Powerlord is offline
DezzY
SourceMod Donor
Join Date: Apr 2012
Location: Portugal
Old 06-21-2014 , 10:46   Re: amx plugin to sourcemod
Reply With Quote #6

I love this guys always keep helping

Tanks so much guys
__________________
DezzY is offline
DezzY
SourceMod Donor
Join Date: Apr 2012
Location: Portugal
Old 06-21-2014 , 10:51   Re: amx plugin to sourcemod
Reply With Quote #7

i compile and give me an error.

/groups/sourcemod/upload_tmp/textiQuSj1.sp(22) : error 037: invalid string (possibly non-terminated string)

1 Error.
__________________
DezzY is offline
DezzY
SourceMod Donor
Join Date: Apr 2012
Location: Portugal
Old 06-21-2014 , 10:56   Re: amx plugin to sourcemod
Reply With Quote #8

Never mind

RegAdminCmd(".cfg", "CFG, ADMFLAG_GENERIC);

u put " alfter CFG

Tanks 1 more time
__________________
DezzY 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 02:45.


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