Hi,
I'm trying to provide players with weapon_gauss from HL. This is how far I've come yet:
Code:
// Give weapon_gauss from HL
// Idea from McDiddy's by superjer :p
// Coding and testing so far by MistaGee
// I altered the cmd_gauss function from csnadedrops.sma to spawn an armoury_entity.
#include <amxmodx>
#include <engine>
public plugin_init(){
register_plugin("Gauss", "0.1 DEV", "MistaGee");
register_concmd("amx_gauss", "cmd_gauss", -1, " ");
}
public plugin_precache(){
precache_model("models/p_gauss.mdl");
precache_model("models/w_gauss.mdl");
precache_model("models/v_gauss.mdl");
//precache_sound();
}
public cmd_gauss(id, level, cid){
new ent_gauss = create_entity("armoury_entity"); // create gauss entity
entity_set_string(ent_gauss,EV_SZ_classname,"gaussentity"); // change name
entity_set_int(ent_gauss,EV_ENT_owner,id); // set owner
entity_set_int(ent_gauss,EV_INT_iuser1,0); // hasn't bounced yet
// set entity's size
new Float:minbox[3] = { -2.5, -2.5, -2.5 }
new Float:maxbox[3] = { 2.5, 2.5, 2.5 };
entity_set_vector(ent_gauss,EV_VEC_mins,minbox);
entity_set_vector(ent_gauss,EV_VEC_maxs,maxbox);
// set overall being of a whole
entity_set_int(ent_gauss,EV_INT_solid,SOLID_TRIGGER);
entity_set_int(ent_gauss,EV_INT_movetype,MOVETYPE_TOSS);
// set a random angle
new Float:angles[3] = { 0.0, 0.0, 0.0 };
angles[1] = float(random_num(0,180));
entity_set_vector(ent_gauss,EV_VEC_angles,angles);
// get player's origin
new Float:origin[3];
entity_get_vector(id,EV_VEC_origin,origin);
origin[0] += 20; // offset
// set model and origin
entity_set_model(ent_gauss,"models/w_gauss.mdl");
entity_set_vector(ent_gauss,EV_VEC_origin,origin);
return PLUGIN_HANDLED;
}
The script spawns an armoury_entity (at least, I think it does

, the weapon shows up...) next to the player calling the command amx_gauss, but the player cannot pick the weapon up. After a few moments, CS seems to completely crash. I think I messed up something big...
You don't need to copy any skins at all since the CS engine seems to get them directly from valve directory.
Plz help me to finish the plugin, it would be really cute... Of course the weapon shall later on cost money, but I don't want to do this easy stuff unless the "main parts" don't work...
thx in advance,
Greetz MGee
__________________