Wilson [29th ID]
04-21-2007, 01:21 AM
This plugin used to work...then one day it just stopped. Around the same time I upgraded to the new version of DoDX..which makes me think maybe that is the reason.
Am I somehow using this wrong, because I sware this used to work and I didn't change it. Or is it that the dodx module needs that native fixed?
#include <amxmodx>
#include <amxmisc>
#include <dodx>
#define PLUGIN "Class A"
#define VERSION "1.0"
#define AUTHOR "29th ID"
new g_isClassA[33], g_bodynum[33];
new g_szMdl[48] = "models/player/us-classa/us-classa.mdl";
new g_szMdlT[48] = "models/player/us-classa/us-classaT.mdl";
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("classa", "toggle_classa");
}
public plugin_precache() {
precache_model(g_szMdl);
precache_model(g_szMdlT);
}
public client_connect( id ) {
g_isClassA[id] = 0;
}
public toggle_classa(id) {
if(!g_isClassA[id])
{
dod_set_model(id, "us-classa");
g_isClassA[id] = 1;
client_print(id, print_chat, "*You are now wearing Class A");
}
else
{
dod_set_model(id, "us-inf");
g_isClassA[id] = 0;
client_print(id, print_chat, "*You are now wearing Field Uniform");
}
return PLUGIN_HANDLED;
}
When I execute the client command, the server crashes, and doesn't log any errors.
Am I somehow using this wrong, because I sware this used to work and I didn't change it. Or is it that the dodx module needs that native fixed?
#include <amxmodx>
#include <amxmisc>
#include <dodx>
#define PLUGIN "Class A"
#define VERSION "1.0"
#define AUTHOR "29th ID"
new g_isClassA[33], g_bodynum[33];
new g_szMdl[48] = "models/player/us-classa/us-classa.mdl";
new g_szMdlT[48] = "models/player/us-classa/us-classaT.mdl";
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("classa", "toggle_classa");
}
public plugin_precache() {
precache_model(g_szMdl);
precache_model(g_szMdlT);
}
public client_connect( id ) {
g_isClassA[id] = 0;
}
public toggle_classa(id) {
if(!g_isClassA[id])
{
dod_set_model(id, "us-classa");
g_isClassA[id] = 1;
client_print(id, print_chat, "*You are now wearing Class A");
}
else
{
dod_set_model(id, "us-inf");
g_isClassA[id] = 0;
client_print(id, print_chat, "*You are now wearing Field Uniform");
}
return PLUGIN_HANDLED;
}
When I execute the client command, the server crashes, and doesn't log any errors.