Raised This Month: $ Target: $400
 0% 

.sma wont compile


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Z3121
Senior Member
Join Date: Mar 2008
Old 04-03-2008 , 00:27   .sma wont compile
Reply With Quote #1

Here is my sma i think i did somthing wrong or i added somthing in wrong place if you were to fix please anyone?

Quote:
// Ichigo - The Legendary Swordsmen

/* CVARS - copy and paste to shconfig.cfg

//Ichigo
ichigo_level 45 //What level he is avalible
ichigo_gravity 2.5 //Gravity
ichigo_health 1250 //Health
ichigo_armor 1200 //Armor
ichigo_knifemult 1.5

#include <amxmodx>
#include <superheromod>



// VARIABLES
new gHeroName[]="Ichigo"
new bool:gHasIchigoPower[SH_MAXSLOTS+1
new g_p_model;
new g_v_model;
new hasPowers = str_to_num(temp)
new extraDamage = floatround(damage * get_cvar_float("Ichigo_mult") - damage);
new damage = read_data(2);
new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)
new headshot = bodypart == 1 ? 1 : 0
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo);
//--------------------------------------------------------------------
public plugin_init()
{
//Plugin Info
register_plugin("SUPERHERO Ichigo", "1.0", "Ak$pecial");

// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
register_cvar("Ichigo_level", "45" )
register_cvar("Ichigo_gravity", "2.5" )
register_cvar("Ichigo_armor", "1250")
register_cvar("Ichigo_health", "1200")
register_cvar("Ichigo_mult", "1.5");

// FIRE THE EVENT TO CREATE THIS SUPERHERO!
shCreateHero(gHeroName, "Bankai Mode", "Hidden with Bankai", false, "Ichigo_level");

// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
register_event("Damage", "Event_damage","b");


//INIT
register_srvcmd("Ichigo_init", "Ichigo_init");
shRegHeroInit(gHeroName, "Ichigo_init");
}
//--------------------------------------------------------------------
public Ichigo_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 flash
read_argv(2,temp,5)
new hasPowers = str_to_num(temp)

// Ichigo the hidden bankai...
if ( !hasPowers && gHasSuperPower[id] && is_user_alive(id) ) {
shRemHealthPower(id)
shRemGravityPower(id)
shRemArmorPower(id)

//Sets this variable to the current status
gHasSuperPower[id] = (hasPowers != 0)
}
}
//--------------------------------------------------------------------
public Event_damage(id) {
if (!shModActive() || !is_user_alive(id)) return PLUGIN_CONTINUE;


/*if (bodypart == 1) {
headshot = 1;
} else {
headshot = 0;
}*/

if(attacker <= 0 || attacker > SH_MAXSLOTS ) return PLUGIN_CONTINUE;

if(gHasIchigoPower[attacker] && is_user_alive(id)) {

if (extraDamage > 0) {
shExtraDamage( id, attacker, extraDamage, "Ichigo damage Mult", headshot );
}
}
}
//--------------------------------------------------------------------
public plugin_precache() {
//

precache_model("models/shmod/Ichigo/Ichigo_v_weapon_model.mdl");
}

public Super_init() {
//

if(hasPowers) { r
Ichigo_set_model(id)
}
//
}

public Super_set_model(id) {
if (!shModActive() || !is_user_alive(id) || !HasSuperPower[id]) return;


if(wpnid == WEAPON_ID_CSW_KNIFE) {
set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, g_v_model));
}
}

Last edited by Z3121; 04-03-2008 at 00:31. Reason: edit a lil
Z3121 is offline
Z3121
Senior Member
Join Date: Mar 2008
Old 04-03-2008 , 00:43   Re: .sma wont compile
Reply With Quote #2

lol i think i know wat i did wrong my first time and i still cant get it to work

some of these are not suppose to be there [QUOTE][// VARIABLES
new gHeroName[]="Ichigo"
new bool:gHasIchigoPower[SH_MAXSLOTS+1
new g_p_model;
new g_v_model;
new hasPowers = str_to_num(temp)
new extraDamage = floatround(damage * get_cvar_float("Ichigo_mult") - damage);
new damage = read_data(2);
new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart)
new headshot = bodypart == 1 ? 1 : 0
new clip, ammo, wpnid = get_user_weapon(id,clip,ammo);
/QUOTE]

but can somone help me this my first time =O
Z3121 is offline
broWnie_maN
Senior Member
Join Date: Aug 2006
Old 04-03-2008 , 06:34   Re: .sma wont compile
Reply With Quote #3

if you wanna code basic heroes like yours with just hp, ap, speed gravity and damagemult to any weapon use Jtpizzalover's Superhero Generator

http://forums.alliedmods.net/showthread.php?t=52521

otherwise wait for someone to fix it
broWnie_maN is offline
G-Dog
Senior Member
Join Date: Dec 2005
Location: Thunderstorm Central
Old 04-03-2008 , 12:20   Re: .sma wont compile
Reply With Quote #4

Code:
// ichigo - The Legendary Swordsmen

/* CVARS - copy and paste to shconfig.cfg

//ichigo
ichigo_level 45 //What level he is avalible
ichigo_gravity 2.5 //Gravity
ichigo_health 1250 //Health
ichigo_armor 1200 //Armor
ichigo_knifemult 1.5

*/

#include <amxmodx>
#include <superheromod>
#include <fakemeta> 	//for the model setting

// VARIABLES
new gHeroName[]="ichigo";
new bool:gHasIchigoPower[SH_MAXSLOTS+1];
new mult;

new const g_v_model[] = "models/shmod/ichigo/ichigo_v_weapon_model.mdl";
//--------------------------------------------------------------------
public plugin_init()
{
	//Plugin Info
	register_plugin("SUPERHERO ichigo", "1.0", "Ak$pecial");
	
	// DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
	register_cvar("ichigo_level", "45" );
	register_cvar("ichigo_gravity", "2.5" );
	register_cvar("ichigo_armor", "1250");
	register_cvar("ichigo_health", "1200");
	mult = register_cvar("ichigo_mult", "1.5");
	
	// FIRE THE EVENT TO CREATE THIS SUPERHERO!
	shCreateHero(gHeroName, "Bankai Mode", "Hidden with Bankai", false, "ichigo_level");
	
	//INIT
	register_srvcmd("ichigo_init", "ichigo_init");
	shRegHeroInit(gHeroName, "ichigo_init");
	
	// REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
	register_event("Damage", "Event_damage", "b", "2!0");
	register_event("CurWeapon", "weaponChange","be","1=1")
	
	shSetMaxHealth(gHeroName, "ichigo_health");
	shSetMaxArmor(gHeroName, "ichigo_armor");
	shSetMinGravity(gHeroName, "ichigo_gravity");
}
//--------------------------------------------------------------------
public ichigo_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 flash
	read_argv(2,temp,5);
	new hasPowers = str_to_num(temp);
	
	// ichigo the hidden bankai...
	if ( hasPowers ) set_model(id);
	
	if ( !hasPowers && gHasIchigoPower[id] && is_user_connected(id) ) {
		shRemHealthPower(id);
		shRemGravityPower(id);
		shRemArmorPower(id);
	}
	//Sets this variable to the current status
	gHasIchigoPower[id] = (hasPowers != 0);
}
//--------------------------------------------------------------------
public Event_damage(id)
{
	if ( !shModActive() || !is_user_alive(id) || !gHasIchigoPower[id] ) return;

	new damage = read_data(2);
	new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart);
	new headshot = bodypart == 1 ? 1 : 0;

	if ( attacker <= 0 || attacker > SH_MAXSLOTS ) return;

	if ( gHasIchigoPower[attacker] && weapon == CSW_KNIFE ) {
		// do extra damage
		new extraDamage = floatround(damage * get_pcvar_float(mult) - damage);
		if (extraDamage > 0) shExtraDamage(id, attacker, extraDamage, "Ichigo damage Mult", headshot);
	}
}
//--------------------------------------------------------------------
public plugin_precache() 
{
	precache_model(g_v_model);
}
//--------------------------------------------------------------------
public weaponChange(id)
{
	if ( !shModActive() ) return
	if ( gHasIchigoPower[id] ) {

		new wpnid = read_data(2)
	
		if ( wpnid == CSW_KNIFE ) set_model(id)
	}
}
//--------------------------------------------------------------------
public set_model(id) 
{
	if ( !is_user_alive(id) ) return
	if ( gHasIchigoPower[id] ) {
		new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
		if (wpnid == CSW_KNIFE) {
			set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, g_v_model))
		}
	}

}
I would suggest looking thru several of the tutorials. Your code was all over the place.
__________________
If at first you don't succeed, then skydiving isn't for you.
G-Dog is offline
Send a message via AIM to G-Dog
Z3121
Senior Member
Join Date: Mar 2008
Old 04-03-2008 , 16:08   Re: .sma wont compile
Reply With Quote #5

thanks! g-dog i gona just make it from this and i wont use the gen to many errors btw thanks agin!
Z3121 is offline
Z3121
Senior Member
Join Date: Mar 2008
Old 04-03-2008 , 16:10   Re: .sma wont compile
Reply With Quote #6

wait but if i wanted to make this admin hero where whould i add the code? ps. sorry i looked at tutorial but i am still lost so please help
Z3121 is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 04-03-2008 , 16:40   Re: .sma wont compile
Reply With Quote #7

check this maybe work idk havent checked

Code:
// ichigo - The Legendary Swordsmen
/* CVARS - copy and paste to shconfig.cfg
//ichigo
ichigo_level 45 //What level he is avalible
ichigo_gravity 2.5 //Gravity
ichigo_health 1250 //Health
ichigo_armor 1200 //Armor
ichigo_knifemult 1.5
*/
#include <amxmodx>
#include <superheromod>
#include <fakemeta>  //for the model setting
// VARIABLES
new gHeroName[]="ichigo";
new bool:gHasIchigoPower[SH_MAXSLOTS+1];
new mult;
new bool:gIchigoSelected[SH_MAXSLOTS+1]
new const g_v_model[] = "models/shmod/ichigo/ichigo_v_weapon_model.mdl";
//--------------------------------------------------------------------
public plugin_init()
{
 //Plugin Info
 register_plugin("SUPERHERO ichigo", "1.0", "Ak$pecial");
 
 // DO NOT EDIT THIS FILE TO CHANGE CVARS, USE THE SHCONFIG.CFG
 register_cvar("ichigo_level", "45" );
 register_cvar("ichigo_gravity", "2.5" );
 register_cvar("ichigo_armor", "1250");
 register_cvar("ichigo_health", "1200");
 mult = register_cvar("ichigo_mult", "1.5");
 register_cvar("Ichigo_adminflag", "a");
 
 // FIRE THE EVENT TO CREATE THIS SUPERHERO!
 shCreateHero(gHeroName, "Bankai Mode", "Hidden with Bankai", false, "ichigo_level");
 
 //INIT
 register_srvcmd("ichigo_init", "ichigo_init");
 shRegHeroInit(gHeroName, "ichigo_init");
 
 // REGISTER EVENTS THIS HERO WILL RESPOND TO! (AND SERVER COMMANDS)
 register_event("Damage", "Event_damage", "b", "2!0");
 register_event("CurWeapon", "weaponChange","be","1=1")
 
 shSetMaxHealth(gHeroName, "ichigo_health");
 shSetMaxArmor(gHeroName, "ichigo_armor");
 shSetMinGravity(gHeroName, "ichigo_gravity");
}
//--------------------------------------------------------------------
public ichigo_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 flash
 read_argv(2,temp,5);
 new hasPowers = str_to_num(temp);
   
 gHasIchigoPower[id] = (hasPowers != 0); //set have power
    gIchigoSelected[id] = gHasIchigoPower[id];
 
 // ichigo the hidden bankai...
 if ( hasPowers ) set_model(id)
 
 if ( !hasPowers && gHasIchigoPower[id] && is_user_connected(id) ) {
  shRemHealthPower(id);
  shRemGravityPower(id);
  shRemArmorPower(id);
 Ichigo_admincheck(id)
 }
 //Sets this variable to the current status
 gHasIchigoPower[id] = (hasPowers != 0);
}
//--------------------------------------------------------------------
public Event_damage(id)
{
 if ( !shModActive() || !is_user_alive(id) || !gHasIchigoPower[id] ) return;
 new damage = read_data(2);
 new weapon, bodypart, attacker = get_user_attacker(id, weapon, bodypart);
 new headshot = bodypart == 1 ? 1 : 0;
 if ( attacker <= 0 || attacker > SH_MAXSLOTS ) return;
 if ( gHasIchigoPower[attacker] && weapon == CSW_KNIFE ) {
  // do extra damage
  new extraDamage = floatround(damage * get_pcvar_float(mult) - damage);
  if (extraDamage > 0) shExtraDamage(id, attacker, extraDamage, "Ichigo damage Mult", headshot);
 }
}
//--------------------------------------------------------------------
public plugin_precache() 
{
 precache_model(g_v_model);
}
//--------------------------------------------------------------------
public weaponChange(id)
{
 if ( !shModActive() ) return
 if ( gHasIchigoPower[id] ) {
  new wpnid = read_data(2)
 
  if ( wpnid == CSW_KNIFE ) set_model(id)
 }
}
//--------------------------------------------------------------------
public set_model(id) 
{
 if ( !is_user_alive(id) ) return
 if ( gHasIchigoPower[id] ) {
  new clip, ammo, wpnid = get_user_weapon(id,clip,ammo)
  if (wpnid == CSW_KNIFE) {
   set_pev(id, pev_viewmodel, engfunc(EngFunc_AllocString, g_v_model))
  }
 }
}
//---------------------------------------------------------------------
public Ichigo_admincheck(id) {
    new accessLevel[10] = ADMIN_LEVEL_A
    
 if ( gIchigoSelected[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)
        gHasIchigoPower[id] = false
        client_cmd(id, "say drop %s", gHeroName)
    }
}
micke1101 is offline
Z3121
Senior Member
Join Date: Mar 2008
Old 04-03-2008 , 17:35   Re: .sma wont compile
Reply With Quote #8

nice try micke but it had 4 erros lot of loose indention and identifide symbols "Ichigo_admincheck"
Z3121 is offline
micke1101
Veteran Member
Join Date: Jan 2008
Location: Banned-town
Old 04-04-2008 , 11:11   Re: .sma wont compile
Reply With Quote #9

what are you saying man it compiles for me and just 4 loose identations

edit

here it is
Attached Files
File Type: amxx sh_ichigo.amxx (8.8 KB, 137 views)

Last edited by micke1101; 04-04-2008 at 11:14.
micke1101 is offline
Z3121
Senior Member
Join Date: Mar 2008
Old 04-08-2008 , 23:49   Re: .sma wont compile
Reply With Quote #10

sweet
Z3121 is offline
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 20:15.


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