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

[REQ] Point-Box


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Gh00ST Imad
Junior Member
Join Date: Aug 2015
Location: Morroco
Old 08-23-2015 , 07:35   [REQ] Point-Box
Reply With Quote #1

I Need Point-Box For Boxing Mod

[ Point-Box : ?? | Health : ?? ]

PHP Code:
#include <amxmodx> 
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
#include <fun>
#include <engine>
#include <hamsandwich> 
#include <nfvault> 

#define LEVELS 9
#define TASK_CLEAR_KILL 100
#define boxsound 9
#define boxmessage 9
#define NUM_OF_LEVELS 13

// Cached vars
new g_iMaxPlayersg_msgCurWeapon 

// Cvars
new pcvar_enablepcvar_menuknifeenablekillstreaktypepcvar_xp

// Menu
new Menu

// Other stuff
new levels] = { 25691013151821 }
new 
kills33 ] = { 0,... }
new 
deaths33 ] = { 0,... }
new 
kill33 ][ 24 ]
new 
onetime[33]
new 
g_PlayerXP[33];
new 
g_PlayerLevel[33]; 

// Nfvault stuff
new VaultFile[128]
new 
AuthID[33][25]

new const 
LEVEL[NUM_OF_LEVELS] = {
    
200
    
400
    
800
    
1600,
    
3200,
    
6400,
    
12800,
    
25600,
    
51200,
    
100000,
    
100500,
    
103000,
    
150560


// Weapon mdl
new const VIEW_MODEL_CT[ ]    = "models/boxing_mod/v_box_blue.mdl" 
new const VIEW_MODEL_TT[ ]    = "models/boxing_mod/v_box_red.mdl" 
new const PLAYER_MODEL[ ]    = "models/boxing_mod/p_knife.mdl" 

// Sounds
new const boxing_sounds[ ][ ] =
{
    
"boxing_sound/boxing_deploy1.wav",    
    
"boxing_sound/boxing_hit1.wav",    
    
"boxing_sound/boxing_hit2.wav",    
    
"boxing_sound/boxing_hit3.wav",    
    
"boxing_sound/boxing_hit4.wav",    
    
"boxing_sound/boxing_hitwall1.wav",
    
"boxing_sound/boxing_slash1.wav",    
    
"boxing_sound/boxing_slash2.wav",    
    
"boxing_sound/boxing_stab.wav"    
}

new const 
oldknife_sounds[ ][ ] =
{
    
"weapons/knife_deploy1.wav",   
    
"weapons/knife_hit1.wav",   
    
"weapons/knife_hit2.wav",    
    
"weapons/knife_hit3.wav",    
    
"weapons/knife_hit4.wav",    
    
"weapons/knife_hitwall1.wav",  
    
"weapons/knife_slash1.wav",    
    
"weapons/knife_slash2.wav",    
    
"weapons/knife_stab.wav"    
}

new const 
boxsoundsboxsound ][ ] = 
{
    
"boxing_sound/boxbrutal.wav",
    
"boxing_sound/boxmaster.wav",
    
"boxing_sound/boxawesome.wav",
    
"boxing_sound/boxmonster.wav",
    
"boxing_sound/boxultra.wav",
    
"boxing_sound/boxultimate.wav",
    
"boxing_sound/boxcombreaker.wav",
    
"boxing_sound/boxfatality.wav",
    
"boxing_sound/boxgameover.wav"
}

// Messages
new boxmessagesboxmessage ][ ] = 
{
    
"%s: Brutal Combo!",
    
"%s: Master Combo!",
    
"%s: Awesome Combo!",
    
"%s: Monster Combo!",
    
"%s: Ultra Combo!",
    
"%s: Ultimate Combo!",
    
"%s: Combo Breaker!",
    
"%s: Fatality!",
    
"%s: Game Over!"
}

public 
plugin_init( ) 

    
// Plugin info
    
register_plugin"Boxing Mod""2.0""Zapdos1" 
    
register_cvar("Boxing Mod" "2.0"FCVAR_SERVER|FCVAR_PROTECTED)
    
    
// Cvars 
    
pcvar_enable =   register_cvar"amx_boxing""1" )
    
pcvar_menu =     register_cvar"amx_boxmenu""1" )
    
knifeenable =    register_cvar"ut_killstreak_knife","1" )
    
killstreaktype register_cvar"ut_killstreak_advanced""3" )
    
pcvar_xp register_cvar("amx_per_kill""80"
    
    
// Menu
    
register_clcmd"say /boxmenu""abrir_menu" )
    
register_clcmd"say boxmenu""abrir_menu" )
    
register_clcmd"say_team /boxmenu""abrir_menu" )
    
register_clcmd"say_team boxmenu""abrir_menu" )
    
register_clcmd"lastinv""abrir_menu" )
    
    
// Events
    
register_event"CurWeapon""event_CurWeapon""be","1=1" )
    
register_event"HLTV""event_RoundStart""a""1=0""2=0" )
    
register_event"DeathMsg""event_death""a" )
    
register_event("DeathMsg""DeathMsg""a")
    
    
// Ham fwd
    
RegisterHamHam_Spawn"player""fw_PlayerSpawn_Post")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
    
// Fakemeta fwd
    
register_forwardFM_EmitSound"fw_EmitSound" )
    
    
// Message task
    
set_task(100.0"mensaje_menu")
    
set_task(80.0"mensajebienvenida")
    
    
// Lang 
    
register_dictionary"boxing.txt" )   
    
    
// Nfvault
    
register_forward(FM_Sys_Error"SaveLevels"
    
register_forward(FM_GameShutdown"SaveLevels"
    
register_forward(FM_ServerDeactivate "SaveLevels"
    
register_forward(FM_ChangeLevel"SaveLevels")
    
    
nfv_file("DataLevels"VaultFilecharsmax(VaultFile));
    
    
// Cached vars
    
g_iMaxPlayers get_maxplayers( )
    
g_msgCurWeapon get_user_msgid"CurWeapon" )
    
    
// Menu
    
Menu menu_create"\yBoxing Menu""mostrar_menu"
    
menu_additemMenu"\wHealth - Need 3 frags"   "1"
    
menu_additemMenu"\rArmor - Need 6 frags"   "2"
    
menu_additemMenu"\yGravity - Need 12 frags"    "3")
    
menu_additemMenu"\rSilent Walk - Need 18 frags"  "4")
    
menu_additemMenu"\yFaster Speed - Need 21 frags" "5")
    
menu_additemMenu"\yGlow - Need 21 frags"        "6")
    
menu_additemMenu"\rAdmin Menu"                             "7")
    
    
menu_setpropMenuMPROP_EXITNAME"Exit" 
    
menu_setpropMenuMPROP_EXITMEXIT_ALL )


public 
plugin_precache( ) 
{    
    
precache_modelVIEW_MODEL_CT )
    
precache_modelVIEW_MODEL_TT )          
    
precache_modelPLAYER_MODEL 
    
    for( new 
0sizeof boxing_soundsi++ )
        
precache_soundboxing_sounds] )
    
    for( new 
0sizeof boxsoundsi++ )
        
precache_soundboxsounds] )
}

public 
event_RoundStart( ) 

    if( 
get_pcvar_numpcvar_enable ) )
    {
        
        for( new 
1<= g_iMaxPlayersi++ )
        {
            if( 
is_user_connected) )
                
reset_user_knife)
            
        }
    }
}

public 
plugin_cfg()
{
    
    new 
cfgboxing[32]
    
get_configsdir(cfgboxingsizeof cfgboxing 1);
    
    
server_cmd("exec %s/boxing.cfg"cfgboxing)
}  

public 
event_CurWeapon(id
{     
    if(
get_pcvar_num(pcvar_enable))
    {
        new 
weaponID read_data(2
        
        if(
weaponID == CSW_KNIFE)
        {
            if(
get_user_team(id) == 2)
            {
                
entity_set_string(idEV_SZ_viewmodelVIEW_MODEL_CT)   
                
entity_set_string(idEV_SZ_weaponmodelPLAYER_MODEL
            }
            else if(
get_user_team(id) == 1)
            {
                
entity_set_string(idEV_SZ_viewmodelVIEW_MODEL_TT)   
                
entity_set_string(idEV_SZ_weaponmodelPLAYER_MODEL
            }
        }
        else
            
reset_user_knife(id)
    }
}  

public 
fw_EmitSound(idchannel, const sound[])
{
    if(
get_pcvar_num(pcvar_enable))
        for(new 
0sizeof boxing_soundsi++)
    {
        if(
equal(soundoldknife_sounds[i]))
        {
            
emit_sound(idchannelboxing_sounds[i], 1.0ATTN_NORM0PITCH_NORM)
            return 
FMRES_SUPERCEDE
        
}
    }        
    return 
FMRES_IGNORED
}  

stock reset_user_knifeid 
{         
    if(
get_pcvar_num(pcvar_enable))
    {
        
engclient_cmdid"weapon_knife" )
        
emessage_beginMSG_ONEg_msgCurWeapon_id )
        
ewrite_byte)
        
ewrite_byteCSW_KNIFE )
        
ewrite_byte( -)
        
emessage_end( )
    }
}

public 
DeathMsg()
{
    if (!
get_pcvar_num(pcvar_enable)) 
        return;
    
    new 
attacker read_data(1)
    
    if(
g_PlayerLevel[attacker] == NUM_OF_LEVELS)
        return;
    
    
g_PlayerXP[attacker] += get_pcvar_num(pcvar_xp)
    
    if(
g_PlayerXP[attacker] >= LEVEL[g_PlayerLevel[attacker]])
    {
        ++
g_PlayerLevel[attacker];
        
set_hudmessage(255255255, -1.0, -1.006.01.0)
        
show_hudmessage(attacker"^n[Level]: %d  ^n[Exp]: %d"g_PlayerLevel[attacker], g_PlayerXP[attacker])
    }
}  

public 
abrir_menuid )
{
    if( 
get_pcvar_numpcvar_enable ) )
    {
        if( 
get_pcvar_numpcvar_menu ) )
        {
            if( 
is_user_aliveid ) )
                
menu_displayidMenu)
        }
        else
            
client_printidprint_chat"[AMXX] %L"LANG_PLAYER"DISABLE_MESSAGE" )
    }


public 
mostrar_menuidMenuitem )
{
    if ( 
item == MENU_EXIT )
        return 
PLUGIN_HANDLED
    
    
new iData]
    new 
iAccess
    
new iCallback
    
new iName64 ]
    
menu_item_getinfoMenuitemiAccessiData5iName63iCallback )
    
    switch (
str_to_num(iData))
    {
        case 
1
        {
            if(
get_user_frags(id) >= 3)
            {
                if(
onetime[id] == 0)
                {
                    
set_user_health(idget_user_health(id) + 50)
                    
onetime[id] = 1
                
}
                else if(
onetime[id] >= 1)
                {
                    
client_print(idprint_chat"[Boxing Mod] %L "id"ONE_TIME")
                    return 
PLUGIN_HANDLED;
                }
            }
            else
            {
                
client_print(idprint_chat"[Boxing Mod] %L 3 frags!"id"LEVEL_MESSAGE")
            }
        }
        case 
2
        {
            
            if(
get_user_frags(id) >= 6)
            {
                if(
onetime[id] == 0)
                {
                    
set_user_armor(idget_user_armor(id) + 50)
                    
onetime[id] = 1
                
}
                
                else if(
onetime[id] >= 1)
                {
                    
client_print(idprint_chat"[Boxing Mod] %L"id"ONE_TIME")
                    return 
PLUGIN_HANDLED
                
}
            }
            else
            {
                
client_print(idprint_chat"[Boxing Mod] %L 6 frags!"id"LEVEL_MESSAGE")
            }
        }
        case 
3
        {
            if(
get_user_frags(id) >= 12)
            {
                if(
onetime[id] == 0)
                {
                    
set_user_gravity(idget_user_gravity(id) - 0.5
                    
onetime[id] = 1
                
}
                else if(
onetime[id] >= 1)
                {
                    
client_print(idprint_chat"[Boxing Mod] %L"id"ONE_TIME")
                    return 
PLUGIN_HANDLED
                
}
            }
            else
            {
                
client_print(idprint_chat"[Boxing Mod] %L 12 frags!"id"LEVEL_MESSAGE")
            }
        }
        case 
4:
        {
            if(
get_user_frags(id) >= 18)
            {
                if(
onetime[id] == 0)
                {
                    
set_user_footsteps (id1)
                    
onetime[id] = 1
                
}
                else if(
onetime[id] >= 1)
                {
                    
client_print(idprint_chat"[Boxing Mod] %L"id"ONE_TIME")
                    return 
PLUGIN_HANDLED
                
}
            }
            else
            {
                
client_print(idprint_chat"[Boxing Mod] %L 18 frags!"id"LEVEL_MESSAGE")
            }
        }
        case 
5:
        {
            if(
get_user_frags(id) >= 21)
            {
                if(
onetime[id] == 0)
                {
                    
set_user_maxspeed(id270.0)
                    
onetime[id] = 1
                
}
                else if(
onetime[id] >= 1)
                {
                    
client_print(idprint_chat"[Boxing Mod] %L"id"ONE_TIME")
                    return 
PLUGIN_HANDLED
                
}
            }
            else
            {
                
client_print(idprint_chat"[Boxing Mod] %L 21 frags!"id"LEVEL_MESSAGE")
            }
        }
        case 
6:
        {
            if(
get_user_frags(id) >= 21)
            {
                if(
onetime[id] == 0)
                {
                    if(
cs_get_user_team(id) == CS_TEAM_T)
                    {
                        
set_user_rendering (idkRenderFxGlowShell25500kRenderTransAlpha255)
                        
set_user_health(idget_user_health(id) + 100)
                        
set_user_armor(idget_user_armor(id) + 100)
                    }
                    if(
cs_get_user_team(id) == CS_TEAM_CT)
                    {
                        
set_user_rendering (idkRenderFxGlowShell02550kRenderTransAlpha255)
                        
set_user_health(idget_user_health(id) + 100)
                        
set_user_armor(idget_user_armor(id) + 100)
                    }
                    
onetime[id] = 1
                
}
                else if(
onetime[id] >= 1)
                {
                    
client_print(idprint_chat"[Boxing Mod] %L"id"ONE_TIME")
                    return 
PLUGIN_HANDLED
                
}
            }
            else
            {
                
client_print(idprint_chat"[Boxing Mod] %L 21 frags!"id"LEVEL_MESSAGE")
            }
        }
        case 
7:
        {
            if(
get_user_flags(id) & ADMIN_KICK)
            {
                
client_cmd(id"amxmodmenu")
            }
        }
    }
    
    return 
PLUGIN_HANDLED
}


public 
mensaje_menu( )
{
    if(
get_pcvar_num(pcvar_enable))
    {
        
client_print0print_chat"[Boxing Mod] %L"LANG_PLAYER"MENU_TO" )
        
client_print0print_chat"[Boxing Mod] %L"LANG_PLAYER"MENU_MESSAGE" )
    }
}

public 
mensajebienvenida( )
{
    if(
get_pcvar_num(pcvar_enable))
    {
        
client_print0print_chat"[Boxing Mod] %L"LANG_PLAYER"WELCOME_MESSAGE" )
        
client_print0print_chat"[Boxing Mod] %L"LANG_PLAYER"CREDIT_MESSAGE" )
    }
}

public 
event_deathid 
{
    static 
KillerKiller read_data)
    static 
VictimVictim read_data)
    
    new 
weapon24 ]
    
read_data4weapon23 )
    
    if(
get_pcvar_num(pcvar_enable))
    {
        if( 
weapon] == 'k'  && get_pcvar_numknifeenable ) == )
        { 
            static 
KillerName32 ], VictimName32 ]
            
get_user_nameVictimVictimName31 )
            
get_user_nameKillerKillerName31 )
            
            
set_hudmessage2550255, -1.00.3006.06.0 )
            
show_hudmessage0, ( boxmessagesrandom_num 0,) ] ), KillerNameVictimName )
            
            
client_cmd(0,"spk %s"random_num0boxsound-) ) 
        }
        
        
killsKiller ] += 1
        kills
Victim ] = 0
        deaths
Killer ] = 0
        deaths
Victim ] += 1
        
        
for ( new 0LEVELSi++ ) 
        {
            if ( 
killsKiller ] == levels] ) 
            {
                
announceKiller)
                return 
PLUGIN_CONTINUE
            
}
        }
    }
    return 
PLUGIN_CONTINUE
}

announcekillerlevel 
{
    if( (
get_pcvar_numkillstreaktype ) <= ) || get_pcvar_numkillstreaktype ) > 3)
        return 
PLUGIN_HANDLED
    
    
static name32 ]
    
get_user_namekillername31 )
    
    if(
get_pcvar_num(pcvar_enable))
    {    
        
set_hudmessagerandom256 ), random256 ), random256 ), 0.050.6520.026.00.010.1)
        
        switch( 
get_pcvar_numkillstreaktype ) )
        {
            case 
1show_hudmessage0boxmessageslevel ], name )
            case 
2client_cmd0"spk %s"boxsoundslevel ] )
            case 
3
            {
                
show_hudmessage0boxmessageslevel ], name )
                
client_cmd0"spk %s"boxsoundslevel ] )
            }
        }
    }
    return 
PLUGIN_CONTINUE
}

public 
client_connectid 
{
    
killsid ] = 0
    deaths
id ] = 0
    
    
if(!is_user_bot(id))
        
Load(id)
}

public 
client_disconnect(id
{
    if(!
is_user_bot(id))
        
Save(id)
}

public 
client_authorizedid 
{
    if(!
is_user_hltv(id) && !is_user_bot(id))
        
get_user_authid(idAuthID[id], charsmax(AuthID[]));
}

public 
clear_killtaskid )
{
    new 
id taskid-TASK_CLEAR_KILL
    kill
id ][ ] = 0
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type)
{
    if(
get_pcvar_num(pcvar_enable))
    {
        
SetHamParamFloat(4damage 0.2)
        
set_hudmessage(0255255, -1.0, -1.006.03.0)
        
show_hudmessage(attacker"^n[Health: %d]"get_user_health(victim))
    }
}  

public 
fw_PlayerSpawn_Post(id)
{
    if(
get_pcvar_num(pcvar_enable))
    {
        
onetime[id] = 0
    
}
}

public 
client_putinserver(id)
{
    if(
get_pcvar_num(pcvar_enable))
    {
        
set_task(4.0"status"id)
    }
}

public 
status(id)
{
    if(
get_pcvar_num(pcvar_enable))
    {
        
set_hudmessage(2551271270.00.706.01.0)
        
show_hudmessage(id"^n[XP]: %i^n[Level]:%i"g_PlayerXP[id], g_PlayerLevel[id])
        
set_task(1.0"status"id)
    }
    return 
PLUGIN_HANDLED;
}  

public 
SaveLevels() {
    for(new 
id 1id <= g_iMaxPlayersid++) {
        if(
is_user_connected(id)) 
            
Save(id)
    }


Save(id) {
    new 
szKey[40]
    
formatex(szKey 39 "niveles")
    
    new 
data[16]
    
num_to_str(g_PlayerLevel[id], datasizeof(data) - 1)
    
    
nfv_set_data(VaultFileszKeyAuthID[id], data)
}

Load(id) {
    new 
szKey[40]
    
formatexszKey 39 "niveles" AuthID[id])
    
    new 
data[16]
    
nfv_get_data(VaultFileszKeyAuthID[id], datasizeof(data) - 1)
    
g_PlayerLevel[id] = str_to_num(data)

__________________
GH00ST
Gh00ST Imad is offline
Gh00ST Imad
Junior Member
Join Date: Aug 2015
Location: Morroco
Old 09-02-2015 , 20:00   Re: [REQ] Point-Box
Reply With Quote #2

??
__________________
GH00ST
Gh00ST Imad is offline
Killermen
Junior Member
Join Date: Feb 2016
Old 02-01-2016 , 14:18   Re: [REQ] Point-Box
Reply With Quote #3

Add Me (Facebook.com/abdetaouab.bouharrak)
Killermen 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 15:12.


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