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

[Tutorial] Learn to Superhero Script


Post New Thread Reply   
 
Thread Tools Display Modes
brenu
Junior Member
Join Date: Jun 2011
Old 07-22-2011 , 09:27   Re: [Tutorial] Learn to Superhero Script
Reply With Quote #111

Quote:
Originally Posted by Jelle View Post
Thanks =D.

@edit
Sorry for the flood xd...
/topic
Okay, now i'm trying to make again my hero xD.
brenu is offline
Send a message via MSN to brenu
SuperHeroMods
New Member
Join Date: Nov 2011
Old 12-14-2011 , 15:58   Re: [Tutorial] Learn to Superhero Script
Reply With Quote #112

Nice !
SuperHeroMods is offline
martop5hng
Junior Member
Join Date: Mar 2014
Old 03-08-2014 , 13:29   Re: [Tutorial] Learn to Superhero Script
Reply With Quote #113

hi guys this is my code/sma but i can't compile it it say some error
Code:
#include <amxmodx>
#include <superheromod> 
#include <cstrike>

new g_model;
new gHeroName[]="Vendetta" 
public plugin_init() {
    register_plugin("SUPERHERO Vendetta", "1.0", "martop5hng");
   
    register_cvar("vendetta_level", "17");

    shCreateHero(gHeroName, "Hero Power List", "Hero Discription", false, "Super_level"); 
    //superheromod.inc: 
    //stock  shCreateHero(heroName[], heroPower[], heroHelp[], bool:requiresKeyEvents, heroLevel[])

    register_srvcmd("vendetta_init", "vendetta_init");
    
    shRegHeroInit(gHeroName, "vendetta_init");
 //...
   
    register_cvar("vendetta_armor", "4500");
   
    shSetMaxArmor(gHeroName, "vendetta_armor");
	        //...
   
        register_cvar("vendetta_speed", "1300");
   
        shSetMaxSpeed(gHeroName, "vendetta_speed", "[0]");
}
//-------------------------------------------------------------------------------------
public vendetta_init() {
    new temp[6];
    read_argv(1,temp,5); 
    new id = str_to_num(temp); 

    read_argv(2,temp,5); 
    
    new hasPowers = str_to_num(temp);

    gHasSuperPower[id] = (hasPowers != 0);
}
public plugin_init() {
    //...
   
    //see helpful links for event info
    register_event("Damage", "Event_damage","b");

    register_cvar("vendetta_mult", "5.5");
}

public Event_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 
    /*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("vendetta_mult") - damage);
    
        if (extraDamage > 0) {
            shExtraDamage( id, attacker, extraDamage, "vendetta damage Mult", headshot ); 
     }
    }
}

public plugin_precache() {
    //...
   
    g_model = precache_model("models/player/vendetta/vendetta.mdl"); //makes players download the model
}

public Super_init() {
    //...

    if(hasPowers) { 
          vendetta_set_model(id) 
    }
    //...
}
   
public vendetta_set_model(id) {
    if (!shModActive() || !is_user_alive(id) || !gHasSuperPower[id]) return PLUGIN_CONTINUE; 

    cs_set_user_model(id, g_model); //set player model

    return PLUGIN_CONTINUE;
}
martop5hng 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 05:06.


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