|
Author
|
Message
|
|
Member
|

02-28-2006
, 18:22
Can Someone Compile this for me and fix?
|
#1
|
Quote:
#include <amxmodx>
#include <engine> // this plugin requires Engine
public plugin_init() {
register_plugin("oh hello" , "1.0" , "v3x");
register_event("CurWeapon" , "set_models" , "be" , "1=1"); // if we don't check for the isActive parameter then the skins will act up and change unexpectedly on you (if 0)
}
public plugin_precache() {
precache_model("models/v_deagle.mdl"); // the view model
precache_model("models/p_deagle.mdl"); // the player (view) model
public set_models(id) {
if(!is_user_alive(id)) { // if the player is dead for some reason, prevent the rest of the function from being executed
return PLUGIN_CONTINUE;
}
new weapid = read_data(2); // get the weapon ID
switch(weapid) {
case CSW_M4A1: { // check if it's the weapon ID we want (see below for weapon constants)
entity_set_string(id , EV_SZ_viewmodel , "models/v_deagle.mdl"); // set the view model
entity_set_string(id , EV_SZ_weaponmodel , "models/p_deagle.mdl"); // set the player (view) model
}
// this is where you'd add more if needed
}
return PLUGIN_CONTINUE;
}
#include <amxmodx>
#include <engine> // this plugin requires Engine
public plugin_init() {
register_plugin("oh hello" , "1.0" , "v3x");
register_event("CurWeapon" , "set_models" , "be" , "1=1"); // if we don't check for the isActive parameter then the skins will act up and change unexpectedly on you
}
public plugin_precache() {
precache_model("models/v_mymodel.mdl"); // the view model
precache_model("models/p_mymodel.mdl"); // the player (view) model
}
public set_models(id) {
if(!is_user_alive(id)) { // if the player is dead for some reason, prevent the rest of the function from being executed
return PLUGIN_CONTINUE;
}
new weapid = read_data(2); // get the weapon ID
switch(weapid) {
case CSW_M4A1: {
entity_set_string(id , EV_SZ_viewmodel , "models/v_deagle.mdl"); // set the view model
entity_set_string(id , EV_SZ_weaponmodel , "models/p_deagle.mdl"); // set the player (view) model
}
// this is where you'd add more if needed
}
return PLUGIN_CONTINUE;
}
|
|
|
|
|