←  [RSS] Pluginy

AMXX.pl: Support AMX Mod X i SourceMod

»

[forums.alliedmods.net] [CS:S] MVP Hax

Adminek AMXX.PL's Photo Adminek AMXX.PL 10.05.2012

Oh hi.

Someone wanted a way to set MVP count without using SDKHooks. So this method is here. It sets/reads the actual value on the player class. So simple as set it and forget it.

Note: I only tested windows but gamedata has windows,linux, and even mac offsets :3

Natives:


PHP Code:

/* Get the amount of MVP's a client has
*
* @param client Client index to get MVP count for.
*
* @return Returns number of MVP's the client has.
* @error Invalid client index
*/
native GetMVPCount(client);

/* Set the amount of MVP's a client has
*
* @param client Client index to set MVP count for.
* @param count Value to set clients MVP count to.
*
* @noreturn
* @error Invalid client index
*/
native SetMVPCount(client, count);

Example plugin:


PHP Code:

#include <sourcemod>
#include <mvphax>

public OnPluginStart()
{
RegConsoleCmd("sm_getmvp", GetMvp);
RegConsoleCmd("sm_setmvp", SetMvp);
}
public
Action:SetMvp(client, args)
{
new
String:buffer[12];
GetCmdArgString(buffer, sizeof(buffer));
new
value = StringToInt(buffer);
SetMVPCount(client, value);
}
public
Action:GetMvp(client, args)
{
PrintToChat(client, "Your mvp count is %i", GetMVPCount(client));
}

Install:
mvphax.smx -> addons/sourcemod/plugins
mvphax.games.txt -> addons/sourcemod/gamedata
mvphax.inc -> addons/sourcemod/scripting/include (only needed for developing other plugins)

Thats all folks.

Attached Files Dołączona grafika Get Plugin or Get Source (mvphax.sp - 1.6 KB) Dołączona grafika mvphax.games.txt (136 Bytes) Dołączona grafika mvphax.inc (536 Bytes)

Wyświetl pełny artykuł
Quote