Hey guys, please help me!.
Please Please Please!!!.
I need this code...
I made this code and edit some things, but when i go to compiler i see so much errors....
And i'm fix fix and fix many errors.
And now, i have only this errors:
Warning 209: Function Stick_damage should return a value. <108>
Error 035: Argument type mismatch (argument 2) <121>
Warning 225: Unreachable code. <125>
Warning 209: Function Stic_Set_Model should return a value <132>
Warning 204: symbol is assigned value that never used: "g_model" <147>
Please help me!!! D:
Code:
// Stick - Hp, Gravity, Armor, Speed, Gun!
/* CVARS - copy and paste to shconfig.cfg
//Stick
*/
#include <amxmodx>
#include <superheromod>
#include <cstrike>
#include <fakemeta>
// VARIABLES
new gHeroName[]="Stick"
new g_model
new bool:gHasSuperPower[SH_MAXSLOTS+1]
new g_p_model
new g_v_model
//----------------------------------------------------------------------------------------------
public plugin_init()
{
// Plugin Info
register_plugin("SUPERHERO Stick", "1.0", "[SN]KyLava")
register_event("CurWeapon", "Stick_weapon","be","1=1")
register_event("ResetHUD", "Stick_spawn","b")
// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("Stick_level", "12")
register_cvar("Stick_health", "750")
register_cvar("Stick_armor", "100")
register_cvar("Stick_grav", "0.50")
register_cvar("Stick_speed", "400")
register_cvar("Stick_mult", "3.0")
// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(gHeroName, "Hp, Gravity, Armor, Speed, Gun!", "More Health and Armor, Super Speed and Models", false, "Stick_level")
//superheromod.inc:
//stock shCreateHero(heroName[], heroPower[], heroHelp[], bool:requiresKeyEvents, heroLevel[])
// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
register_srvcmd("Stick_init", "Stick_init")
shRegHeroInit(gHeroName, "Stick_init")
register_event("Damage", "Stick_damage","3.0")
// Let Server know about Sticks Variable
shSetMaxHealth(gHeroName, "Stick_health")
shSetMaxArmor(gHeroName, "Stick_armor")
shSetMinGravity(gHeroName, "Stick_grav")
shSetMaxSpeed(gHeroName, "Stick_speed", "[0]")
}
//----------------------------------------------------------------------------------------------
public Stick_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 Stick
read_argv(2,temp,5)
new hasPowers = str_to_num(temp)
if(hasPowers) {
Stick_set_model(id)
}
// Got to take away powers from a user that dropped Stick
gHasSuperPower[id] = (hasPowers != 0)
if (!hasPowers && gHasSuperPower[id] && is_user_alive(id)) {
shRemHealthPower(id)
shRemArmorPower(id)
shRemGravityPower(id)
shRemSpeedPower(id)
}
}
//----------------------------------------------------------------------------------------------
public Stick_damage(id)
{
if (!shModActive() || !is_user_alive(id)) return PLUGIN_CONTINUE
new damage = read_data(2)
new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)
new headshot = bodypart == 1 ? 1 : 0 //this is just short for:
/*if (bodypart == 1) {
headshot = 1
} else {
headshot = 0
}*/
if(attacker <= 0 || attacker > SH_MAXSLOTS ) return PLUGIN_CONTINUE
if(gHasSuperPower[attacker] && is_user_alive(id)) {
new extraDamage = floatround(damage * get_cvar_float("Stick_mult") - damage)
if (extraDamage > 0)
{
shExtraDamage( id, attacker, extraDamage, "Stick damage Mult", headshot ) //superheromod.inc: stock shExtraDamage(id, attacker, damage, weaponDescription[], headshot = 0)
}
}
}
//----------------------------------------------------------------------------------------------
public plugin_precache() {
//Precache Models
g_model = precache_model("models/shmod/Stick/Stick.mdl")
g_p_model = precache_model("models/shmod/Stick/p_Ak-47_Stick.mdl")
g_v_model = precache_model("models/shmod/Stick/v_Ak-47_Stick.mdl")
}
//----------------------------------------------------------------------------------------------
public Stick_set_model(id) {
if (!shModActive() || !is_user_alive(id) || !gHasSuperPower[id]) return PLUGIN_CONTINUE
cs_set_user_model(id, g_model)
return PLUGIN_CONTINUE
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
if(wpnid == CSW_AK47) {
set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, g_v_model))
set_pev(id, pev_weaponmodel, engfunc(EngFunc_AllocString, g_p_model))
}
}
//----------------------------------------------------------------------------------------------
public Stick_weapon(id) {
new clip = read_data(3)
if (clip == 0) {
shReloadAmmo(id)
}
}
//----------------------------------------------------------------------------------------------
public Stick_spawn(id) {
if(gHasSuperPower[id] && is_user_alive(id) && shModActive()) {
shGiveWeapon(id,"weapon_ak47")
}
}
//----------------------------------------------------------------------------------------------