View Single Post
AdamR
Senior Member
Join Date: Dec 2006
Location: Cardiff, South Wales
Old 09-19-2007 , 13:36   Re: SCXPM Exploit Restrictor
Reply With Quote #7

What an excellent plugin idea. Thank you very much for this.

I recommend modifying it to allow administrators to define the maximum number of points though:
Code:
#include <amxmodx>
#include <kve>
#include <fakemeta>
#define MAKE_STRING(%1) "%1"
#define STR_MAX_POINTS MAKE_STRING(MAX_POINTS)

public plugin_precache()
{
	register_keyvalue("game_score", "points", "handle_game_score_points")
}
public plugin_init()
{
	register_plugin("SCXPM Exploit Restrictor", "1.0", "ts2do")
	register_cvar("xp_maxpoints", "1")
}
public handle_game_score_points(szValue[], entid, kvdid)
{
	new maxPoints = get_cvar_num("xp_maxpoints")
	if(str_to_num(szValue) > maxPoints)
	{
		set_kvd(kvdid, KV_Value, STR_MAX_POINTS)
	}
}
^ although that fails, because of the definitions.

Also, this is Pawn. You don't need ; at the end of a statement.

Ignore the first 4 replies. Those guys have no idea what this plugin is about.
__________________
Thanks,

Adam Reece - Sven Co-op team.

Last edited by AdamR; 09-19-2007 at 13:39.
AdamR is offline
Send a message via Skype™ to AdamR