Counter-Strike Federation Welcome , Leecher | RSS | Thursday, 28 March 24
A Place Where Player Becomes Developer Home | Sign Up | Log In
[ New messages · Members · Forum rules · Search · RSS ]
  • Page 1 of 1
  • 1
Forum » AMX Mod X » Unapproved/Old Plugin » Plugin 200 health and Armor | Give_Grenade (Plugin)
Plugin 200 health and Armor | Give_Grenade
Grade: Trainee Galih_Sitopan17Date: Wednesday, 24 June 15, 7:20 AM | Message # 1
Trainee
Clan: Member
Experience: 8
Status: Offline
coba-coba buat plugin ternyata susah juga :v

ini plugin pertama dan kedua ane, kalo ada salah harap maklum :v

list:
- 200_Health = darah dan armor jadi 200
- Give_Grenade = dapat garanat (he,smoke,flashbang)

untuk command lihat 'readme.txt'

link:
 Disini Om
 
Grade: Commander DavidJrDate: Wednesday, 24 June 15, 8:57 AM | Message # 2
Commander
Clan: Executive
Experience: 2256
Status: Offline
Quote Galih_Sitopan17 ()
coba-coba buat plugin ternyata susah juga :vini plugin pertama dan kedua ane, kalo ada salah harap maklum :v

list:
- 200_Health = darah dan armor jadi 200
- Give_Grenade = dapat garanat (he,smoke,flashbang)

untuk command lihat 'readme.txt'

link:
Disini Om
Unapproved.
Tidak ada source code.


posted via BlackBerry

Personal Site | CSF Website
 
Grade: Copral anko()love()leilingDate: Friday, 17 July 15, 7:54 PM | Message # 3
Copral
Clan: Member
Experience: 13
Status: Offline
Cant dl It
BTW. Here, My (light) Version:
note:this plugin's never tested!

Code
#include <amxmodx>
#include <amxmisc>
#include <cstrike>    // Should Use Fakemeta Or Engine (Or Both)
#include <fun>        // These's Just Making More Module Needed

#define PLUGIN "Misc" // i like the old style
#define VERSION "0.0" // Has You Noticed?
#define AUTHOR "anko"

//new Add_Hp = 100;
/*new Add_Ar = 200;*/
//cvar
new Add_Hp;
new Add_Arm;

public plugin_init() {
     
    register_plugin(PLUGIN, VERSION, AUTHOR);
     
    register_clcmd("amx_add_health", "add_health");
    Add_Hp = register_cvar("amx_add_health_by", "100");
     
    register_clcmd("amx_add_armor", "add_armor");
    Add_Arm = register_cvar("amx_add_armor_by", "100");
     
    register_clcmd("amx_give_grenade", "give_grenade");
     
    register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0");
}

public add_health(iIndex){
     
    if(!is_user_alive(iIndex)) return; //                       I Should Make This As A Stock(Or Public)
    if(!is_user_connected(iIndex)) return; //                   This Is Stupid
    if(is_user_connecting(iIndex)) return; //                   This One Too
    new Hp = get_user_health(iIndex);
    set_user_health(iIndex, Hp + Add_Hp);
}

public add_armor(iIndex){
     
    if(!is_user_alive(iIndex)) return; //                       Creating This
    if(!is_user_connected(iIndex)) return; //                   is Just Wasting
    if(is_user_connecting(iIndex)) return; //                    Time
     
    new Ar = get_user_armor(iIndex);
    set_user_armor(iIndex, Ar + Add_Arm);
}
/*

                    //I Should Use The Easiest Way
new const grenade[][] ={
     
    CSW_HEGRENADE, CSW_FLASHBANG, CSW_SMOKEGRENADE
}
                    //Baka!
new Bool:Has_Added[33]

*/
public give_grenade(Index){
     
    if(!is_user_alive(Index)) return;//     At Least
    if(!is_user_connected(Index)) return;// These Code
    if(is_user_connecting(Index)) return//   Work Perfectly
     
    new Fl[1]; /* Firstly We(or i) Should Know What The Grenade's ClassName */
    get_weaponname(CSW_FLASHBANG, Fl, charsmax(Fl));
    new He[1];                    //I Newer Know What These Entity's Classes
    get_weaponname(CSW_HEGRENADE, He, charsmax(He));
    new Sm[1];                    //That's Why I Use These
    get_weaponname(CSW_SMOKEGRENADE, Sm, charsmax(Sm));
                    //Poorly Coded, Should Use The Fastest Way
    give_item(Index, Fl);
    give_item(Index, He);
    give_item(Index, Sm);
}

public Event_NewRound(){
     
    new Players[32], Pnum, Index;
    get_players(Players, Pnum, "a"); // Poorly Coded?
    for(new i;i<Pnum;i++)
    {
                       //All Players
       Index = Players[i];
        
       if(!is_user_alive(Index)) return;
       if(!is_user_connected(Index)) return;
       if(is_user_connecting(Index)) return

       add_health(Index); // Fastest
//      add_armor(Index); //  Way?
        
       give_grenade(Index);
        
    //   Set Health Event
//      new Hp = get_user_health(index);
//      set_user_health(index, Hp + Add_Hp);
        
    //   Set Armor Event
    //   new Ar = get_user_armor(index); Would Cause Unbalanced GamePlay
       set_user_armor(Index, /* Ar + */ Add_Arm);  
    }   
}

Quote
You Can 'Do' Everything You Wanted To. But, You Cant 'Be' Everything .-


work, learn, think, explore, research

 
Grade: Commander DavidJrDate: Monday, 20 July 15, 1:05 PM | Message # 4
Commander
Clan: Executive
Experience: 2256
Status: Offline
anko()love()leiling, actually, that's better

posted via BlackBerry

Personal Site | CSF Website
 
Forum » AMX Mod X » Unapproved/Old Plugin » Plugin 200 health and Armor | Give_Grenade (Plugin)
  • Page 1 of 1
  • 1
Search:

Mirum
sample map