Raised This Month: $ Target: $400
 0% 

[REQ] Choose class


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 05-16-2015 , 02:07   Re: [REQ] Choose class
Reply With Quote #1

Im very tired, havent tested. so, goodnight.

Credit regen code: Sylwester

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN "Marvel stuff"
#define VERSION "1.0"
#define AUTHOR "Skumek"

//A little config 
#define COST 16000
#define FLASH_SPEED 310.0
#define DAMAGE_HULK 2.0
#define CATWOMAN_ARMOR 160
#define CATWOMAN_HP 160
#define IRONMAN_ARMOR 200
#define IRONMAN_HP 200
#define HP_RESTORE_ARMOUNT 1
#define AMOUNT_INVISIBLE 16

//Task
#define TASK_REGEN 20150516
//Macros
#define Get_BitVar(%1,%2)        (%1 & (1 << (%2 & 31)))
#define Set_BitVar(%1,%2)        (%1 |= (1 << (%2 & 31)));
#define UnSet_BitVar(%1,%2)        (%1 &= ~(1 << (%2 & 31)));

#define MAX_NAME 7

new const g_Names[MAX_NAME][] = {
    
"The Hulk",
    
"Cat Woman",
    
"Iron Man",
    
"Dracula",
    
"Invisible Woman",
    
"Wolverine",
    
"Flash"
}

//Classes
new g_Hulkg_CatWomang_IronMang_Vampireg_Invisibleg_Wolverineg_Flash

//Get 'em
new g_MaxPlayers 

//Some stuffs
new g_MaxHealth[33]

public 
plugin_init() {
    
register_pluginPLUGINVERSIONAUTHOR )
    
    
//Ham
    
RegisterHam(Ham_Spawn"player""fw_Spawn"1)
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
//Event
    
register_event("CurWeapon""Event_CurWeapon""be""1=1")
    
register_event"TextMsg""Event_RoundRestart""a""2&#Game_C""2&#Game_w" )
    
register_event("DeathMsg""DeathMessage""a")
    
    
//Get em
    
g_MaxPlayers get_maxplayers()
    
    
//Cmd
    
register_clcmd"say /marvel""Open_SkinMenu" )
    
register_clcmd"sayteam /marvel""Open_SkinMenu" )
}

public 
client_connectid ResetAllid )
public 
client_disconnectid ResetAllid )
public 
Event_RoundRestartid ResetAllid )

public 
Event_CurWeaponid )
{
    if( 
is_user_aliveid ))
    {
        if( 
Get_BitVar(g_Flashid )) set_user_maxspeedidFLASH_SPEED
        else if( 
Get_BitVar(g_Wolverineid )) set_task(1.0"Regen_Health"2152__"b")
            else if( 
Get_BitVar(g_Invisibleid )) fm_set_user_renderingidkRenderFxNone000kRenderTransAlphaAMOUNT_INVISIBLE )        
        }
}

public 
fw_TakeDamage(VictimAttackerFloatDamageDamageType)
{    
    if(!
is_user_alive(Attacker))
        return 
HAM_IGNORED;
    
    if(
Get_BitVar(g_HulkAttacker))
    {    
        
SetHamParamFloat(4Damage DAMAGE_HULK)
        return 
HAM_HANDLED;
    }
    return 
HAM_IGNORED;
}

public 
fw_Spawnid )
{
    if(!
is_user_alive(id))
        return 
    
    new 
CsArmorType:ArmorType 
    
    g_MaxHealth
[id] = get_user_health(id)
    
    if(
Get_BitVar(g_IronManid ))
    {
        
cs_set_user_armoridIRONMAN_ARMORArmorType )
        
set_user_health(idIRONMAN_HP )
    }
    else if(
Get_BitVar(g_CatWomanid ))
    {
        
cs_set_user_armoridCATWOMAN_ARMORArmorType )
        
set_user_healthidCATWOMAN_HP )
    }
    
}

public 
Open_SkinMenuid )
{
    if(!
is_user_aliveid ))
        return 
PLUGIN_CONTINUE
    
    
static  Title64 ]
    
    
formatexTitlecharsmaxTitle ), "Class Selection^n" )
    
    static 
iMenuiMenu menu_createTitle"MenuHandle_SkinMenu" )
    
    new 
NumNumStr]
    
    for( new 
0MAX_NAMEi++ )
    {    
        
Num i
        num_to_str
NumNumStrcharsmaxNumStr ) )
        
menu_additemiMenug_NamesNum ], NumStr)
    }
    
    
menu_setpropiMenuMPROP_EXITMEXIT_ALL )
    
menu_displayidiMenu )
    
    return 
PLUGIN_HANDLED
}

public 
MenuHandle_SkinMenuidiMenuiItem )
{
    if( 
iItem == MENU_EXIT )
        return 
PLUGIN_CONTINUE
    
if( !is_user_connectedid ) )
        return 
PLUGIN_CONTINUE
    
    
new _TrashKey]
    
menu_item_getinfoiMenuiItem_TrashKeycharsmaxKey ), ""0_Trash )
    
    new 
KeyItem str_to_numKey 
    
    if( 
is_user_aliveid ) )
    {
        switch( 
KeyItem )
        {
            case 
0Set_BitVarg_Hulkid )
                case 
1Set_BitVarg_CatWomanid )
                case 
2Set_BitVarg_IronManid)
                case 
3Set_BitVarg_Vampireid )
                case 
4Set_BitVarg_Invisibleid )
                case 
5Set_BitVarg_Wolverineid )
                case 
6Set_BitVarg_Flashid )
                default: 
ResetAll(id)
            
        }
        
cs_set_user_money(idcs_get_user_money(id) - COST)
        
client_print_colorid0"You have chosen Class: ^4[%s]",  g_NamesKeyItem ] )
    }
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
Regen_Health()
{
    static 
idhp
    
    
for(id=1id<=g_MaxPlayersid++){
        if(!
is_user_alive(id))
            continue
        
        
hp get_user_health(id)
        if(
hp >= g_MaxHealth[id])
            
g_MaxHealth[id] = hp
        
else
            
set_user_health(idhp+HP_RESTORE_ARMOUNT)
    }
}  
public 
DeathMessage()
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    
    if(
Get_BitVar(g_Vampirekiller))
    {    
        if(
is_user_alive(killer) && get_user_team(killer) != get_user_team(victim))
        {
            
DeathMsg(killer,victim,read_data(3));
        }
    }
}

public 
DeathMsg(kidvidhs)
    
set_user_health(kidmin(get_user_health(kid)+(hs?30:15),255));

public 
ResetAllid )
{
    
UnSet_BitVar(g_Hulkid)
    
UnSet_BitVar(g_CatWomanid)
    
UnSet_BitVar(g_Flashid)
    
UnSet_BitVar(g_Invisibleid)
    
UnSet_BitVar(g_IronManid)
    
UnSet_BitVar(g_CatWomanid)
    
UnSet_BitVar(g_Wolverineid)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1042\\ f0\\ fs16 \n\\ par }
*/ 
__________________
Contact: Steam
Videos: Youtube

Last edited by SkumTomteN; 05-16-2015 at 02:14.
SkumTomteN is offline
black_heart
Senior Member
Join Date: May 2015
Old 05-16-2015 , 06:53   Re: [REQ] Choose class
Reply With Quote #2

Quote:
Originally Posted by SkumTomteN View Post
Im very tired, havent tested. so, goodnight.

Credit regen code: Sylwester

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN "Marvel stuff"
#define VERSION "1.0"
#define AUTHOR "Skumek"

//A little config 
#define COST 16000
#define FLASH_SPEED 310.0
#define DAMAGE_HULK 2.0
#define CATWOMAN_ARMOR 160
#define CATWOMAN_HP 160
#define IRONMAN_ARMOR 200
#define IRONMAN_HP 200
#define HP_RESTORE_ARMOUNT 1
#define AMOUNT_INVISIBLE 16

//Task
#define TASK_REGEN 20150516
//Macros
#define Get_BitVar(%1,%2)        (%1 & (1 << (%2 & 31)))
#define Set_BitVar(%1,%2)        (%1 |= (1 << (%2 & 31)));
#define UnSet_BitVar(%1,%2)        (%1 &= ~(1 << (%2 & 31)));

#define MAX_NAME 7

new const g_Names[MAX_NAME][] = {
    
"The Hulk",
    
"Cat Woman",
    
"Iron Man",
    
"Dracula",
    
"Invisible Woman",
    
"Wolverine",
    
"Flash"
}

//Classes
new g_Hulkg_CatWomang_IronMang_Vampireg_Invisibleg_Wolverineg_Flash

//Get 'em
new g_MaxPlayers 

//Some stuffs
new g_MaxHealth[33]

public 
plugin_init() {
    
register_pluginPLUGINVERSIONAUTHOR )
    
    
//Ham
    
RegisterHam(Ham_Spawn"player""fw_Spawn"1)
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
//Event
    
register_event("CurWeapon""Event_CurWeapon""be""1=1")
    
register_event"TextMsg""Event_RoundRestart""a""2&#Game_C""2&#Game_w" )
    
register_event("DeathMsg""DeathMessage""a")
    
    
//Get em
    
g_MaxPlayers get_maxplayers()
    
    
//Cmd
    
register_clcmd"say /marvel""Open_SkinMenu" )
    
register_clcmd"sayteam /marvel""Open_SkinMenu" )
}

public 
client_connectid ResetAllid )
public 
client_disconnectid ResetAllid )
public 
Event_RoundRestartid ResetAllid )

public 
Event_CurWeaponid )
{
    if( 
is_user_aliveid ))
    {
        if( 
Get_BitVar(g_Flashid )) set_user_maxspeedidFLASH_SPEED
        else if( 
Get_BitVar(g_Wolverineid )) set_task(1.0"Regen_Health"2152__"b")
            else if( 
Get_BitVar(g_Invisibleid )) fm_set_user_renderingidkRenderFxNone000kRenderTransAlphaAMOUNT_INVISIBLE )        
        }
}

public 
fw_TakeDamage(VictimAttackerFloatDamageDamageType)
{    
    if(!
is_user_alive(Attacker))
        return 
HAM_IGNORED;
    
    if(
Get_BitVar(g_HulkAttacker))
    {    
        
SetHamParamFloat(4Damage DAMAGE_HULK)
        return 
HAM_HANDLED;
    }
    return 
HAM_IGNORED;
}

public 
fw_Spawnid )
{
    if(!
is_user_alive(id))
        return 
    
    new 
CsArmorType:ArmorType 
    
    g_MaxHealth
[id] = get_user_health(id)
    
    if(
Get_BitVar(g_IronManid ))
    {
        
cs_set_user_armoridIRONMAN_ARMORArmorType )
        
set_user_health(idIRONMAN_HP )
    }
    else if(
Get_BitVar(g_CatWomanid ))
    {
        
cs_set_user_armoridCATWOMAN_ARMORArmorType )
        
set_user_healthidCATWOMAN_HP )
    }
    
}

public 
Open_SkinMenuid )
{
    if(!
is_user_aliveid ))
        return 
PLUGIN_CONTINUE
    
    
static  Title64 ]
    
    
formatexTitlecharsmaxTitle ), "Class Selection^n" )
    
    static 
iMenuiMenu menu_createTitle"MenuHandle_SkinMenu" )
    
    new 
NumNumStr]
    
    for( new 
0MAX_NAMEi++ )
    {    
        
Num i
        num_to_str
NumNumStrcharsmaxNumStr ) )
        
menu_additemiMenug_NamesNum ], NumStr)
    }
    
    
menu_setpropiMenuMPROP_EXITMEXIT_ALL )
    
menu_displayidiMenu )
    
    return 
PLUGIN_HANDLED
}

public 
MenuHandle_SkinMenuidiMenuiItem )
{
    if( 
iItem == MENU_EXIT )
        return 
PLUGIN_CONTINUE
    
if( !is_user_connectedid ) )
        return 
PLUGIN_CONTINUE
    
    
new _TrashKey]
    
menu_item_getinfoiMenuiItem_TrashKeycharsmaxKey ), ""0_Trash )
    
    new 
KeyItem str_to_numKey 
    
    if( 
is_user_aliveid ) )
    {
        switch( 
KeyItem )
        {
            case 
0Set_BitVarg_Hulkid )
                case 
1Set_BitVarg_CatWomanid )
                case 
2Set_BitVarg_IronManid)
                case 
3Set_BitVarg_Vampireid )
                case 
4Set_BitVarg_Invisibleid )
                case 
5Set_BitVarg_Wolverineid )
                case 
6Set_BitVarg_Flashid )
                default: 
ResetAll(id)
            
        }
        
cs_set_user_money(idcs_get_user_money(id) - COST)
        
client_print_colorid0"You have chosen Class: ^4[%s]",  g_NamesKeyItem ] )
    }
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
Regen_Health()
{
    static 
idhp
    
    
for(id=1id<=g_MaxPlayersid++){
        if(!
is_user_alive(id))
            continue
        
        
hp get_user_health(id)
        if(
hp >= g_MaxHealth[id])
            
g_MaxHealth[id] = hp
        
else
            
set_user_health(idhp+HP_RESTORE_ARMOUNT)
    }
}  
public 
DeathMessage()
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    
    if(
Get_BitVar(g_Vampirekiller))
    {    
        if(
is_user_alive(killer) && get_user_team(killer) != get_user_team(victim))
        {
            
DeathMsg(killer,victim,read_data(3));
        }
    }
}

public 
DeathMsg(kidvidhs)
    
set_user_health(kidmin(get_user_health(kid)+(hs?30:15),255));

public 
ResetAllid )
{
    
UnSet_BitVar(g_Hulkid)
    
UnSet_BitVar(g_CatWomanid)
    
UnSet_BitVar(g_Flashid)
    
UnSet_BitVar(g_Invisibleid)
    
UnSet_BitVar(g_IronManid)
    
UnSet_BitVar(g_CatWomanid)
    
UnSet_BitVar(g_Wolverineid)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1042\\ f0\\ fs16 \n\\ par }
*/ 
amm when i write /marvel and choose class i get it with 800$ and it should be 16000$
i think it should add something that says "you dont have enought money, make more kills to earn it"
black_heart is offline
Send a message via Skype™ to black_heart
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 05-16-2015 , 12:11   Re: [REQ] Choose class
Reply With Quote #3

Quote:
Originally Posted by black_heart View Post
amm when i write /marvel and choose class i get it with 800$ and it should be 16000$
i think it should add something that says "you dont have enought money, make more kills to earn it"
Try this:

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN "Marvel stuff"
#define VERSION "1.0"
#define AUTHOR "Skumek"

//A little config 
#define COST 16000
#define FLASH_SPEED 310.0
#define DAMAGE_HULK 2.0
#define CATWOMAN_ARMOR 160
#define CATWOMAN_HP 160
#define IRONMAN_ARMOR 200
#define IRONMAN_HP 200
#define HP_RESTORE_ARMOUNT 1
#define AMOUNT_INVISIBLE 16

//Macros
#define Get_BitVar(%1,%2)        (%1 & (1 << (%2 & 31)))
#define Set_BitVar(%1,%2)        (%1 |= (1 << (%2 & 31)));
#define UnSet_BitVar(%1,%2)        (%1 &= ~(1 << (%2 & 31)));

#define MAX_NAME 7

new const g_Names[MAX_NAME][] = {
    
"The Hulk",
    
"Cat Woman",
    
"Iron Man",
    
"Dracula",
    
"Invisible Woman",
    
"Wolverine",
    
"Flash"
}

//Classes
new g_Hulkg_CatWomang_IronMang_Vampireg_Invisibleg_Wolverineg_Flash

//Get 'em
new g_MaxPlayers 

//Some stuffs
new g_MaxHealth[33]

public 
plugin_init() {
    
register_pluginPLUGINVERSIONAUTHOR )
    
    
//Ham
    
RegisterHam(Ham_Spawn"player""fw_Spawn"1)
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
//Event
    
register_event("CurWeapon""Event_CurWeapon""be""1=1")
    
register_event"TextMsg""Event_RoundRestart""a""2&#Game_C""2&#Game_w" )
    
register_event("DeathMsg""DeathMessage""a")
    
    
//Get em
    
g_MaxPlayers get_maxplayers()
    
    
//Cmd
    
register_clcmd"say /marvel""Open_SkinMenu" )
    
register_clcmd"sayteam /marvel""Open_SkinMenu" )
}

public 
client_connectid ResetAllid )
public 
client_disconnectid ResetAllid )
public 
Event_RoundRestartid ResetAllid )

public 
Event_CurWeaponid )
{
    if( 
is_user_aliveid ))
    {
        if( 
Get_BitVar(g_Flashid )) set_user_maxspeedidFLASH_SPEED
        else if( 
Get_BitVar(g_Wolverineid )) set_task(1.0"Regen_Health"2152__"b")
            else if( 
Get_BitVar(g_Invisibleid )) fm_set_user_renderingidkRenderFxNone000kRenderTransAlphaAMOUNT_INVISIBLE )        
        }
}

public 
fw_TakeDamage(VictimAttackerFloatDamageDamageType)
{    
    if(!
is_user_alive(Attacker))
        return 
HAM_IGNORED;
    
    if(
Get_BitVar(g_HulkAttacker))
    {    
        
SetHamParamFloat(4Damage DAMAGE_HULK)
        return 
HAM_HANDLED;
    }
    return 
HAM_IGNORED;
}

public 
fw_Spawnid )
{
    if(!
is_user_alive(id))
        return 
    
    new 
CsArmorType:ArmorType 
    
    g_MaxHealth
[id] = get_user_health(id)
    
    if(
Get_BitVar(g_IronManid ))
    {
        
cs_set_user_armoridIRONMAN_ARMORArmorType )
        
set_user_health(idIRONMAN_HP )
    }
    else if(
Get_BitVar(g_CatWomanid ))
    {
        
cs_set_user_armoridCATWOMAN_ARMORArmorType )
        
set_user_healthidCATWOMAN_HP )
    }
    
}

public 
Open_SkinMenuid )
{
    if(!
is_user_aliveid ))
        return 
PLUGIN_CONTINUE
    
    
static  Title64 ]
    
    
formatexTitlecharsmaxTitle ), "Class Selection^n" )
    
    static 
iMenuiMenu menu_createTitle"MenuHandle_SkinMenu" )
    
    new 
NumNumStr]
    
    for( new 
0MAX_NAMEi++ )
    {    
        
Num i
        num_to_str
NumNumStrcharsmaxNumStr ) )
        
menu_additemiMenug_NamesNum ], NumStr)
    }
    
    
menu_setpropiMenuMPROP_EXITMEXIT_ALL )
    
menu_displayidiMenu )
    
    return 
PLUGIN_HANDLED
}

public 
MenuHandle_SkinMenuidiMenuiItem )
{
    if( 
iItem == MENU_EXIT )
        return 
PLUGIN_CONTINUE
    
if( !is_user_connectedid ) )
        return 
PLUGIN_CONTINUE
    
if(cs_get_user_money(id) < 16000)
        {
        
client_print(idprint_chat"Sorry, you dont have enough money")
        return 
PLUGIN_CONTINUE
    
}
        
    new 
_TrashKey]
    
menu_item_getinfoiMenuiItem_TrashKeycharsmaxKey ), ""0_Trash )
    
    new 
KeyItem str_to_numKey 
    
    if( 
is_user_aliveid ) )
    {
        switch( 
KeyItem )
        {
            case 
0Set_BitVarg_Hulkid )
                case 
1Set_BitVarg_CatWomanid )
                case 
2Set_BitVarg_IronManid)
                case 
3Set_BitVarg_Vampireid )
                case 
4Set_BitVarg_Invisibleid )
                case 
5Set_BitVarg_Wolverineid )
                case 
6Set_BitVarg_Flashid )
                default: 
ResetAll(id)
            
        }
        
cs_set_user_money(id, (cs_get_user_money(id) - COST))
        
client_print_colorid0"You have chosen Class: ^4[%s]",  g_NamesKeyItem ] )
    }
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
Regen_Health()
{
    static 
idhp
    
    
for(id=1id<=g_MaxPlayersid++){
        if(!
is_user_alive(id))
            continue
        
        
hp get_user_health(id)
        if(
hp >= g_MaxHealth[id])
            
g_MaxHealth[id] = hp
        
else
            
set_user_health(idhp+HP_RESTORE_ARMOUNT)
    }
}  
public 
DeathMessage()
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    
    if(
Get_BitVar(g_Vampirekiller))
    {    
        if(
is_user_alive(killer) && get_user_team(killer) != get_user_team(victim))
        {
            
DeathMsg(killer,victim,read_data(3));
        }
    }
}

public 
DeathMsg(kidvidhs)
    
set_user_health(kidmin(get_user_health(kid)+(hs?30:15),255));

public 
ResetAllid )
{
    
UnSet_BitVar(g_Hulkid)
    
UnSet_BitVar(g_CatWomanid)
    
UnSet_BitVar(g_Flashid)
    
UnSet_BitVar(g_Invisibleid)
    
UnSet_BitVar(g_IronManid)
    
UnSet_BitVar(g_CatWomanid)
    
UnSet_BitVar(g_Wolverineid)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1042\\ f0\\ fs16 \n\\ par }
*/ 
__________________
Contact: Steam
Videos: Youtube
SkumTomteN is offline
black_heart
Senior Member
Join Date: May 2015
Old 05-16-2015 , 16:06   Re: [REQ] Choose class
Reply With Quote #4

Quote:
Originally Posted by SkumTomteN View Post
Try this:

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <fakemeta_util>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#define PLUGIN "Marvel stuff"
#define VERSION "1.0"
#define AUTHOR "Skumek"

//A little config 
#define COST 16000
#define FLASH_SPEED 310.0
#define DAMAGE_HULK 2.0
#define CATWOMAN_ARMOR 160
#define CATWOMAN_HP 160
#define IRONMAN_ARMOR 200
#define IRONMAN_HP 200
#define HP_RESTORE_ARMOUNT 1
#define AMOUNT_INVISIBLE 16

//Macros
#define Get_BitVar(%1,%2)        (%1 & (1 << (%2 & 31)))
#define Set_BitVar(%1,%2)        (%1 |= (1 << (%2 & 31)));
#define UnSet_BitVar(%1,%2)        (%1 &= ~(1 << (%2 & 31)));

#define MAX_NAME 7

new const g_Names[MAX_NAME][] = {
    
"The Hulk",
    
"Cat Woman",
    
"Iron Man",
    
"Dracula",
    
"Invisible Woman",
    
"Wolverine",
    
"Flash"
}

//Classes
new g_Hulkg_CatWomang_IronMang_Vampireg_Invisibleg_Wolverineg_Flash

//Get 'em
new g_MaxPlayers 

//Some stuffs
new g_MaxHealth[33]

public 
plugin_init() {
    
register_pluginPLUGINVERSIONAUTHOR )
    
    
//Ham
    
RegisterHam(Ham_Spawn"player""fw_Spawn"1)
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
//Event
    
register_event("CurWeapon""Event_CurWeapon""be""1=1")
    
register_event"TextMsg""Event_RoundRestart""a""2&#Game_C""2&#Game_w" )
    
register_event("DeathMsg""DeathMessage""a")
    
    
//Get em
    
g_MaxPlayers get_maxplayers()
    
    
//Cmd
    
register_clcmd"say /marvel""Open_SkinMenu" )
    
register_clcmd"sayteam /marvel""Open_SkinMenu" )
}

public 
client_connectid ResetAllid )
public 
client_disconnectid ResetAllid )
public 
Event_RoundRestartid ResetAllid )

public 
Event_CurWeaponid )
{
    if( 
is_user_aliveid ))
    {
        if( 
Get_BitVar(g_Flashid )) set_user_maxspeedidFLASH_SPEED
        else if( 
Get_BitVar(g_Wolverineid )) set_task(1.0"Regen_Health"2152__"b")
            else if( 
Get_BitVar(g_Invisibleid )) fm_set_user_renderingidkRenderFxNone000kRenderTransAlphaAMOUNT_INVISIBLE )        
        }
}

public 
fw_TakeDamage(VictimAttackerFloatDamageDamageType)
{    
    if(!
is_user_alive(Attacker))
        return 
HAM_IGNORED;
    
    if(
Get_BitVar(g_HulkAttacker))
    {    
        
SetHamParamFloat(4Damage DAMAGE_HULK)
        return 
HAM_HANDLED;
    }
    return 
HAM_IGNORED;
}

public 
fw_Spawnid )
{
    if(!
is_user_alive(id))
        return 
    
    new 
CsArmorType:ArmorType 
    
    g_MaxHealth
[id] = get_user_health(id)
    
    if(
Get_BitVar(g_IronManid ))
    {
        
cs_set_user_armoridIRONMAN_ARMORArmorType )
        
set_user_health(idIRONMAN_HP )
    }
    else if(
Get_BitVar(g_CatWomanid ))
    {
        
cs_set_user_armoridCATWOMAN_ARMORArmorType )
        
set_user_healthidCATWOMAN_HP )
    }
    
}

public 
Open_SkinMenuid )
{
    if(!
is_user_aliveid ))
        return 
PLUGIN_CONTINUE
    
    
static  Title64 ]
    
    
formatexTitlecharsmaxTitle ), "Class Selection^n" )
    
    static 
iMenuiMenu menu_createTitle"MenuHandle_SkinMenu" )
    
    new 
NumNumStr]
    
    for( new 
0MAX_NAMEi++ )
    {    
        
Num i
        num_to_str
NumNumStrcharsmaxNumStr ) )
        
menu_additemiMenug_NamesNum ], NumStr)
    }
    
    
menu_setpropiMenuMPROP_EXITMEXIT_ALL )
    
menu_displayidiMenu )
    
    return 
PLUGIN_HANDLED
}

public 
MenuHandle_SkinMenuidiMenuiItem )
{
    if( 
iItem == MENU_EXIT )
        return 
PLUGIN_CONTINUE
    
if( !is_user_connectedid ) )
        return 
PLUGIN_CONTINUE
    
if(cs_get_user_money(id) < 16000)
        {
        
client_print(idprint_chat"Sorry, you dont have enough money")
        return 
PLUGIN_CONTINUE
    
}
        
    new 
_TrashKey]
    
menu_item_getinfoiMenuiItem_TrashKeycharsmaxKey ), ""0_Trash )
    
    new 
KeyItem str_to_numKey 
    
    if( 
is_user_aliveid ) )
    {
        switch( 
KeyItem )
        {
            case 
0Set_BitVarg_Hulkid )
                case 
1Set_BitVarg_CatWomanid )
                case 
2Set_BitVarg_IronManid)
                case 
3Set_BitVarg_Vampireid )
                case 
4Set_BitVarg_Invisibleid )
                case 
5Set_BitVarg_Wolverineid )
                case 
6Set_BitVarg_Flashid )
                default: 
ResetAll(id)
            
        }
        
cs_set_user_money(id, (cs_get_user_money(id) - COST))
        
client_print_colorid0"You have chosen Class: ^4[%s]",  g_NamesKeyItem ] )
    }
    
menu_destroyiMenu );
    return 
PLUGIN_HANDLED;
}

public 
Regen_Health()
{
    static 
idhp
    
    
for(id=1id<=g_MaxPlayersid++){
        if(!
is_user_alive(id))
            continue
        
        
hp get_user_health(id)
        if(
hp >= g_MaxHealth[id])
            
g_MaxHealth[id] = hp
        
else
            
set_user_health(idhp+HP_RESTORE_ARMOUNT)
    }
}  
public 
DeathMessage()
{
    new 
killer read_data(1);
    new 
victim read_data(2);
    
    if(
Get_BitVar(g_Vampirekiller))
    {    
        if(
is_user_alive(killer) && get_user_team(killer) != get_user_team(victim))
        {
            
DeathMsg(killer,victim,read_data(3));
        }
    }
}

public 
DeathMsg(kidvidhs)
    
set_user_health(kidmin(get_user_health(kid)+(hs?30:15),255));

public 
ResetAllid )
{
    
UnSet_BitVar(g_Hulkid)
    
UnSet_BitVar(g_CatWomanid)
    
UnSet_BitVar(g_Flashid)
    
UnSet_BitVar(g_Invisibleid)
    
UnSet_BitVar(g_IronManid)
    
UnSet_BitVar(g_CatWomanid)
    
UnSet_BitVar(g_Wolverineid)
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1042\\ f0\\ fs16 \n\\ par }
*/ 
its working perfect ... you are awesome!!! Thank you (bow)
black_heart is offline
Send a message via Skype™ to black_heart
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 05-16-2015 , 18:13   Re: [REQ] Choose class
Reply With Quote #5

Quote:
Originally Posted by black_heart View Post
its working perfect ... you are awesome!!! Thank you (bow)
No problem
__________________
Contact: Steam
Videos: Youtube
SkumTomteN 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:11.


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