Raised This Month: $32 Target: $400
 8% 

My Bomb Game


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Eviatar Mor
Senior Member
Join Date: Jun 2014
Location: israel
Old 08-25-2014 , 13:41   My Bomb Game
Reply With Quote #1

Hey,
So I Try Make My OWN BombGame (Like Bomb Game OF Exolent & Zedox)
I Made This Plugin:
PHP Code:
/* Plugin generated by AMXX-Studio */

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

#define PLUGIN "Bomb Game"
#define VERSION "1.0"
#define AUTHOR "/A/"

#define _random(%1) random_num(0, %1 - 1)  
#define TIME 30
#define TASKID 1337
#define    FL_WATERJUMP    (1<<11)    // player jumping out of water
#define    FL_ONGROUND    (1<<9)    // At rest / on the ground
#define BitHideKnife(%1)         ( BitKnife |= ( 1 << ( %1 & 31 ) ) )
#define BitShowKnife(%1)         ( BitKnife &= ~( 1 << ( %1 & 31 ) ) )
#define BitCheckKnife(%1)        ( BitKnife & ( 1 << ( %1 & 31 ) ) )

new iTime
new szName33 ]
new 
Glow
new BitKnife;

new 
gBuyCommands[][] = 
{
     
"usp""glock""deagle""p228""elites""fn57""m3""xm1014""mp5""tmp""p90""mac10""ump45""ak47"
    
"galil""famas""sg552""m4a1""aug""scout""awp""g3sg1""sg550""m249""vest""vesthelm""flash""hegren",
    
"sgren""defuser""nvgs""shield""primammo""secammo""km45""9x19mm""nighthawk""228compact""12gauge",
    
"autoshotgun""smg""mp""c90""cv47""defender""clarion""krieg552""bullpup""magnum""d3au1""krieg550",
    
"buyammo1""buyammo2"


new 
gCvarPluginToggle 

public plugin_init() {
    
register_event("CurWeapon""event_current_weapon""be""1=1")
    
register_logevent("logevent_round_start"2"1=Round_Start")  
    
register_logevent("logevent_round_start1"2"1=Round_Start")  
    
register_logevent("logevent_round_start2"2"1=Round_Start"
    
register_logevent("logevent_round_end"2"1=Round_End"
    
register_forwardFM_PlayerPreThink "fwdPlayerPreThink" )
    
RegisterHam(Ham_Spawn"player""player_spawn"1)
    
RegisterHamHam_Spawn"player""fwdPlayerSpawn")
    
register_cvar("amx_gamename","BombGame 2.0.0");
         
register_forward(FM_GetGameDescription,"GameDesc");
    
gCvarPluginToggle register_cvar("amx_block_buy""1"
    for (new 
isizeof gBuyCommandsi++)
         
register_clcmd(gBuyCommands[i], "BlockBuyCommands"
    
Glow register_cvar"amx_techno""1" )
    
register_cvar("sbhopper_version""1.2"FCVAR_SERVER)
    
register_cvar("bh_enabled""1")
    
register_cvar("bh_autojump""1")
    
register_cvar("bh_showusage""1")
    
RegisterHamHam_Spawn"player""OnCBasePlayer_Spawn_P", .Post=);
    
RegisterHamHam_Spawn"player""FwdHamPlayerSpawn1"1)
}


public 
plugin_precache(){
    
precache_model("models/lol/v_bomb.mdl")  
    
precache_model("models/lol/Infected.mdl")
}

public 
BlockBuyCommands(id)
{

    if (!
get_pcvar_num(gCvarPluginToggle))
        return 
PLUGIN_CONTINUE;

    return 
PLUGIN_HANDLED;


public 
event_current_weapon(id){
    if (
read_data(2) == CSW_C4){
        
set_pev(idpev_viewmodel2"models/lol/v_bomb.mdl")
    }
    return 
PLUGIN_CONTINUE
}


public 
logevent_round_start(client){
    
    
    
         
iTime TIME
     
      set_task
1.0"countdown"TASKID__"a"TIME )
    
        
set_hudmessage(17900, -1.0, -1.020.021.00.010.110)
        
show_hudmessageclient"Time: 30 Seconds"iTime)
    
        static 
randomplayer
    
    
static players[32], numiid
    get_players
(playersnum"a")
    
    
randomplayer players[_random(num)]
    
    for(
0numi++)
    {
        
id players[i]
        if(
id == randomplayer)    
        {
            new 
userid get_user_userid(id)
        
fm_give_item(id"weapon_c4");
       
get_user_name(useridszNamecharsmax(szName))
       
show_hudmessage(client"%s chosen randomly"szName)
       
ColorChat(clientRED"^03%s Are Infected!"szName)
       if ( 
iTime <= ){
       
client_cmduserid"kill")
}
        }
    }
}  

public 
countdown()
{
    if( 
iTime >= )
    {    
        
iTime--
        
        
set_hudmessage(17900, -1.0, -1.020.021.00.010.110)
        
show_hudmessage0"Time: %i Seconds"iTime )
    
    
    }
}  

public 
fwdPlayerPreThinkid )
{
    if( 
is_user_aliveid ) )
    {
        
set_pevidpev_fuser2 0.0 )
    }


public 
player_spawn(userid){
if(
cs_get_user_team(userid) == CS_TEAM_T ){
           
cs_set_user_model(userid"Infected")
        
    }
    
}

public 
GameDesc()
{
    new 
gamename[32];
    
get_cvar_string("amx_gamename",gamename,31);
    
forward_return(FMV_STRING,gamename);
    return 
FMRES_SUPERCEDE;


public 
fwdPlayerSpawnuserid )
{
     if(
is_user_aliveuserid ) )

     
Glowsuserid )
}

public 
Glowsuserid )
{
     
set_task(3.0"Glows"userid)
     if( 
is_user_aliveuserid ) && get_pcvar_numGlow ) )
     {
             
set_user_rendering(useridkRenderFxGlowShell,  random_num0,255 ),  random_num0,255 ),  random_num0,255 ), kRenderNormal16 )

     }

}

public 
client_PreThink(id) {
    if (!
get_cvar_num("bh_enabled"))
        return 
PLUGIN_CONTINUE

    entity_set_float
(idEV_FL_fuser20.0)        

    if (!
get_cvar_num("bh_autojump"))
        return 
PLUGIN_CONTINUE
    
    
if (entity_get_int(idEV_INT_button) & 2) {    
        new 
flags entity_get_int(idEV_INT_flags)

        if (
flags FL_WATERJUMP)
            return 
PLUGIN_CONTINUE
        
if ( entity_get_int(idEV_INT_waterlevel) >= )
            return 
PLUGIN_CONTINUE
        
if ( !(flags FL_ONGROUND) )
            return 
PLUGIN_CONTINUE

        
new Float:velocity[3]
        
entity_get_vector(idEV_VEC_velocityvelocity)
        
velocity[2] += 250.0
        entity_set_vector
(idEV_VEC_velocityvelocity)

        
entity_set_int(idEV_INT_gaitsequence6)    
    }
    return 
PLUGIN_CONTINUE
}
public 
client_authorized(id)
    
set_task(30.0"showUsage"id)

public 
showUsage(id) {
    if ( !
get_cvar_num("bh_enabled") || !get_cvar_num("bh_showusage") )
        return 
PLUGIN_HANDLED

    
if ( !get_cvar_num("bh_autojump") ) {
        
client_print(idprint_chat"[LoL Bomb Game] Bunny hopping is enabled on this server. You will not slow down after jumping.")
    } else {
        
client_print(idprint_chat"[LoL Bomb Game] Auto bunny hopping is enabled on this server. Just hold down jump to bunny hop.")
    }
    return 
PLUGIN_HANDLED
}

public 
logevent_round_start1(client)
{
    
client_cmd(client,"bh_autojump 1")
    
fm_set_user_health(client100)
}

public 
OnCBasePlayer_Spawn_Pindex )
{
    if( 
is_user_aliveindex ) && get_user_teamindex ) == )
    {
        
BitHideKnifeindex );
        
Ham_StripWeaponindex"weapon_knife" );
    }
}

public 
logevent_round_start2index ){
        if( 
BitCheckKnifeindex ) )
    {
        
BitShowKnifeindex );
        
give_itemindex"weapon_knife" );
    }
    else
    {
        
BitHideKnifeindex );
        
Ham_StripWeaponindex"weapon_knife" );
    }
    return 
PLUGIN_HANDLED;
}

stock Ham_StripWeapon(index,weapon[])
{
    if(!
equal(weapon,"weapon_",7)) return 0;
    
    new 
wId get_weaponid(weapon);
    if(!
wId) return 0;
    
    new 
wEnt;
    while((
wEnt engfunc(EngFunc_FindEntityByString,wEnt,"classname",weapon)) && pev(wEnt,pev_owner) != index ) {}
    if(!
wEnt) return 0;
    
    if(
get_user_weaponindex ) == wId
        
ExecuteHamB(Ham_Weapon_RetireWeapon,wEnt);
    
    if(!
ExecuteHamB(Ham_RemovePlayerItem,index,wEnt) ) return 0;
    
ExecuteHamB(Ham_Item_Kill,wEnt);
    
    
set_pevindex,pev_weapons,pevindex,pev_weapons) & ~(1<<wId));
    
    return 
1;
}  

public 
FwdHamPlayerSpawn1(id){
if(
is_user_alive(id) && is_user_connected(id))
    {
        
fm_set_user_health(id1000)
}

so i beginner on pawn and i try make BombGame but i dont know how to infected the one pickup the bomb.
so i try to take from anothers mods codes and put on my plugin!
but it did not work so good!
and when i compiler the code i have 9 warnings! and i dont know how to fix that!
and what i try to do is: when start round player choosen randomaly and he cant use weapon only with c4 and he knife hiding and when 30 seconds done he got slay!(when the guy was choosen randomaly glow and hes have model)! and if there all palyers got slay and only one player stay alive its say The winner is %s ! and the game restart hes self alone!

So I'd be happy if someone added someone to pick up the bomb and if someone is glued to correct the errors Thanks!
(THIS MOD ALMOST LIKE HIT&RUN)
sorry about my bad english !
and thanks a lot about helps!

Last edited by Eviatar Mor; 08-25-2014 at 13:49.
Eviatar Mor 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 17:42.


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