hey guys this is the first hero ive actually done now im guessing im missing something here but the hero loads fine but it doesnt get the weapon in the game its just a simple gun hero notting big can some one tell me why heres the code
Code:
//This is my first hero so please just go with it =P
#include <amxmodx> //Include the library which it will use.
#include <superheromod> //Superhero Mod library.
//--------------------------------------------------------------------------------------------------
//Global Variables
new gHeroName[]="Toxicv2" //Define the hero name
new bool:gHasToxicv2Power[SH_MAXSLOTS+1]
//--------------------------------------------------------------------------------------------------
public plugin_init() {
//Plugin info
register_plugin("SUPERHERO Toxicv2","1.0","Detox") //Self Explainatory
//DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("toxicv2_level", "50" ) //What level is this hero available.
register_cvar("toxicv2_getm4a1", "1") //1 get m4a1 0 dont get one
// DEFAULT THE CVARS (GREEN ARROW)
if ( !cvar_exists("toxicv2_level") ) register_cvar("toxicv2_level", "10")
if ( !cvar_exists("toxicv2_getm4a1") ) register_cvar("toxicv2_getm4a1", "1")
//fire the event to create this hero
shCreateHero(gHeroName, "Toxicv2", "Detox version2", false, "toxicv2_level" )
//init
register_srvcmd("toxicv2_init", "toxicv2_init")
register_event("CurWeapon", "make_toxicv2", "be", "1=1", "3>0")
shRegHeroInit(gHeroName, "toxicv2_init")
}
//--------------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_model("models/shmod/toxicv2_v_m4a1.mdl")
precache_model("models/shmod/toxicv2_p_m4a1.mdl")
precache_model("models/shmod/toxicv2_w_m4a1.mdl")
return PLUGIN_CONTINUE
}
//----------------------------------------------------------------------------------------------
public toxicv2_init()
{
// First Argument is an id
new temp[6]
read_argv(1,temp,5)
new id=str_to_num(temp)
// 2nd Argument is 0 or 1 depending on whether the id has GreenLantern
read_argv(2,temp,5)
new hasPowers = str_to_num(temp)
gHasToxicv2Power[id] = (hasPowers!=0)
}
//--------------------------------------------------------------------------------------------------
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/