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

[HELP] send a cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joneco
Junior Member
Join Date: Jul 2013
Old 09-12-2013 , 14:48   [HELP] send a cvar
Reply With Quote #1

hi, i'm having trouble with one plugin i tried to edit that but not succesfull =(, hi have 3 servers with bhop i put the sv_autobhop 1 in casual cfg and server cfg but in one server is not working.
I need to connect and add the cvar manually...
i just need a simple plugin to edit this cvar when a map start.

like when plugin start change sv_bhop to 1.

how can i do that? i know is very simple. Can anyone help? thanks
joneco is offline
cREANy0
SourceMod Donor
Join Date: Jul 2012
Location: Germany
Old 09-12-2013 , 14:59   Re: [HELP] send a cvar
Reply With Quote #2

You could try this. (not tested!)

Code:
#include <sourcemod>
#pragma semicolon 1

public Plugin:myinfo =
{
	name = "Enable sv_bhop",
	author = "cREANy0 (code by Sheepdude)",
	description = "Sets sv_bhop to 1 on map start",
	version = "1.0",
	url = "-"
};

new Handle:SV_BHOP = INVALID_HANDLE;

public OnPluginStart()
{
	SV_BHOP = FindConVar("sv_bhop");
	HookEvent("round_freeze_end", OnNewRound, EventHookMode_Pre);
}

public OnNewRound(Handle:event, const String:name[], bool:dontBroadcast)
{
	if(SV_BHOP != INVALID_HANDLE)
		SetConVarInt(SV_BHOP, 1);
}
Code by Sheepdude (Link) and edit by me for your request.


greetz cREANy0
Attached Files
File Type: sp Get Plugin or Get Source (sv_bhop_enable.sp - 264 views - 538 Bytes)
__________________

Last edited by cREANy0; 09-12-2013 at 15:00.
cREANy0 is offline
joneco
Junior Member
Join Date: Jul 2013
Old 09-12-2013 , 23:47   Re: [HELP] send a cvar
Reply With Quote #3

o thanks, a friend of mine helped me, now is working the plugin change the cvar every round like this...
almost the same =)
thanks
joneco 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 01:42.


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