Raised This Month: $51 Target: $400
 12% 

HELP COMPILING


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
andjak123
Junior Member
Join Date: Jan 2009
Old 03-28-2009 , 19:50   HELP COMPILING
Reply With Quote #1

I am trying to make a hero its a m4a1 with damage multiplayer and unlimited ammo, and speed hp ap and hp-regen. and last, admin onley. but i cant compile it, i have fixen the most errors, but i cant fix the last to errors. plz help me. i have postet the Sma file below. If you help me, i will give you + karma.
Attached Files
File Type: sma Get Plugin or Get Source (sh_kiljaden.sma - 242 views - 4.2 KB)

Last edited by andjak123; 03-29-2009 at 04:02.
andjak123 is offline
andjak123
Junior Member
Join Date: Jan 2009
Old 04-04-2009 , 09:29   Re: HELP COMPILING
Reply With Quote #2

Here is the Sma Codec:

//Created By *HS Pro-aimer

#include <superheromod>
#include <amxmodx>
new gHeroName[]="Kiljaden"
new gHeroID
new bool:gHasKiljaden[SH_MAXSLOTS+1]
new bool:gHasKiljadenPowers[SH_MAXSLOTS+1]
new bool:gKiljadenSelected[SH_MAXSLOTS+1]
new bool:gKiljadenPowers[SH_MAXSLOTS+1]
new gPcvarHealPoints
new gPcvarm4a1Mult
//----------------------------------------------------------------------------------------------
public plugin_init()
{
register_plugin("SUPERHERO KilJaden", "1.0", "*HS Pro-Aimer")

new pcvarLevel = register_cvar("Kiljaden_level", "70")
new pcvarHealth = register_cvar("Kiljaden_health", "40000")
new pcvarArmor = register_cvar("Kiljaden_armor", "10000")
new pcvarSpeed = register_cvar("Kiljaden_speed", "1500")
gPcvarm4a1Mult = register_cvar("Kiljaden_m4a1mult", "90.8")
gPcvarHealPoints = register_cvar("Kiljaden_healpoints", "100")
register_cvar("Kiljaden_admins_immune", "0")
register_cvar("Kiljaden_adminflag", "a")

new heroID = sh_create_hero("Kiljaden", pcvarLevel)
sh_set_hero_info(heroID, "UNKNOWN POWERS", "Forces of the Darkness")
sh_set_hero_hpap(heroID, pcvarHealth,pcvarArmor)
sh_set_hero_speed(heroID, pcvarSpeed)
set_task(1.0, "Kiljaden_loop", _, _, _, "b")
register_event("CurWeapon", "weapon_change", "be", "1=1")
}
public plugin_precache()
{
precache_model("models/shmod/Kiljaden_v_m4a1.mdl")
precache_model("models/shmod/Kiljaden_p_m4a1.mdl")
}
public sh_hero_init(id, heroID, mode)
{
if ( gHeroID != heroID ) return

switch(mode) {
case SH_HERO_ADD: {
gHasKiljaden[id] = true

switch_model(id)
}
case SH_HERO_DROP: {
gHasKiljaden[id] = false
if ( is_user_alive(id) ) {
}
}
}
}
//----------------------------------------------------------------------------------------------
public Kiljaden_loop()
{
if ( !sh_is_active() ) return

static players[SH_MAXSLOTS], playerCount, player, i
get_players(players, playerCount, "ah")
for ( i = 0; i < playerCount; i++ ) {
player = players[i]

if ( gHasKiljaden[player] ) {
sh_add_hp(player, get_pcvar_num(gPcvarHealPoints))
}
}
}
//----------------------------------------------------------------------------------------------
public client_damage(attacker, victim, damage, wpnindex, hitplace)
{
if ( !sh_is_active() ) return
if ( !is_user_alive(victim) || !is_user_connected(attacker) ) return

if ( gHasKiljaden[attacker] && wpnindex == CSW_M4A1 ) {
new headshot = hitplace == 1 ? 1 : 0

new extraDamage = floatround(damage * get_pcvar_float(gPcvarm4a1Mult) - damage)
if ( extraDamage > 0 ) sh_extra_damage(victim, attacker, extraDamage, "m4a1", headshot)
}
}
public weapon_change(id)
{
if ( !sh_is_active() || !gHasKiljaden[id] ) return

if ( read_data(2) == CSW_M4A1 ) switch_model(id)
if ( read_data(3) == 0 ) {
sh_reload_ammo(id, 1)
}
}
}
public switch_model(id)
{
if ( !sh_is_active() || !is_user_alive(id) || !gHasKiljaden[id] ) return

if ( cs_get_user_shield(id) ) return
if ( get_user_weapon(id) == CSW_M4A1 ) {
set_pev(id, pev_viewmodel2, "models/shmod/Kiljaden_v_m4a1.mdl")
set_pev(id, pev_weaponmodel2, "models/shmod/Kiljaden_p_m4a1.mdl")
}
}
public Kiljaden_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 the hero
read_argv(2,temp,5)
new hasPowers = str_to_num(temp)

gHasKiljadenPower[id] = (hasPowers != 0)
gKiljadenSelected[id] = gHasKiljadenPower[id]

if ( gHasKiljadenPower[id] && is_user_connected(id) ) {
Kiljaden_admincheck(id)
}
}
public Kiljaden_admincheck(id)
{
new accessLevel[10]

get_cvar_string("Kiljaden_adminflag", accessLevel, 9)

if ( gKiljadenSelected[id] && !(get_user_flags(id)&read_flags(accessLevel)) ) {
client_print(id, print_chat, "[SH](%s) **Admin Only** You are not authorized to use this hero", gHeroName)
gKiljadenPower[id] = false
client_cmd(id, "say drop %s", gHeroName)
}
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1030\\ f0\\ fs16 \n\\ par }
*/
andjak123 is offline
Supervoodoo
Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-19-2009 , 15:56   Re: HELP COMPILING
Reply With Quote #3

LOL MAN THIS CODE IS SO GOD DAMN WRONG YOU SHOULDNT PUT THE INIT IN THE END OF THE FILE ITS THE INIT(INITIALIZATION PART OF THE FILE=THE BEGINING OF THE FILE (Not In The End)) OF THE FILE
Supervoodoo is offline
Send a message via Skype™ to Supervoodoo
Supervoodoo
Member
Join Date: Jul 2009
Location: Bulgaria
Old 07-19-2009 , 15:56   Re: HELP COMPILING
Reply With Quote #4

I didnt LOok For More Mistakes But Still
Supervoodoo is offline
Send a message via Skype™ to Supervoodoo
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:36.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode