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);
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));
}
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



Wyświetl pełny artykuł