Raised This Month: $ Target: $400
 0% 

[MOD] Panic Mod


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
fpA
Senior Member
Join Date: May 2011
Location: Zaragoza
Old 09-28-2011 , 13:53   [MOD] Panic Mod
Reply With Quote #1

Hello,

I'm developing my first mod, and i need some help.

For now, I have the base of the mod, but i need ideas and help.
  • Add more game modes.
  • Add infinite bullets to "soldier".
  • Add a menu, with shop,rules,help and admin "submenus".
  • Create soldiers and aliens classes.
  • And optimize the code.

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

/* =============================== GENERAL =============================== */

new maxplayers
new hud_message

new bool:b_round[33]

public 
plugin_init(){
    
register_plugin("Panic Mod""0.0.1""FPA")
    
    
register_dictionary("pm_lang.txt")
    
    
register_clcmd("drop""DisableDrop")
    
    
set_task(1.0"Status"0""0"b")
    
    
register_logevent("RoundStart"2"1=RoundStart")
    
register_logevent("RoundEnd"2"1=RoundEnd")

    
RegisterHam(Ham_TakeDamage"player""ChangeDamage")
    
    
maxplayers get_maxplayers()
    
hud_message CreateHudSyncObj()    
}
public 
Status(id){ 
    
set_hudmessage(02550, -1.00.906.03.0
    
ShowSyncHudMsg(idhud_message"%L : %i %L : %i %L : %i""HEALTH_HUD"get_user_health(id), "ARMOR_HUD"get_user_armor(id), "POINTS_HUD",  get_user_frags(id))
}
public 
RoundStart(id){
    
set_task(30.0"Game_Start")
    
set_hudmessage(025500.30.1506.05.0)
    
show_hudmessage(0"%L"id"START_MESSAGE")
}
public 
RoundEnd(id){
    
b_round[id] = false
}
public 
GameStart(id){
    new 
round random_num (1,2)
    switch(
round){
        case 
:{
            if(
b_round[id] == false){
                
b_round[id] = true
                alien_round
(id)
                
set_hudmessage(025500.30.1506.05.0)
                
show_hudmessage(0"%L"id"ALIEN_ROUND")
            }
        }
        case 
:{
            if(
b_round[id] == false){
                
b_round[id] = true
                soldier_round
(id)
                
set_hudmessage(025500.30.1506.05.0)
                
show_hudmessage(0"%L"id"SOLDIER_ROUND")
            }
        }
    }
    return 
PLUGIN_HANDLED
}
public 
ChangeDamage(victim,  attackerFloat:damagedamage_bits){ 
    if(
cs_get_user_team(attacker)==CS_TEAM_T)
        
SetHamParamFloat(4damage 1.54
}
/* =============================== OTHERS =============================== */
public client_putinserver(id){
    new 
name[32]
    
get_user_name(idnamecharsmax(name))

    
client_print(idprint_chat"%L"id"MENU_MESSAGE")
    
client_print(idprint_chat"%L"id"WELCOME_MESSAGE")
}
public 
DisableBuyzone(){
    new 
ent find_ent_by_class(-1,"info_map_parameters")
    if(!
ent){
        
ent create_entity("info_map_parameters")
    }
    
DispatchKeyValue(ent,"buying","3")
    
DispatchSpawn(ent)
}
public 
DisableDrop(){
    return 
PLUGIN_HANDLED
}
/* =============================== ROUNDS =============================== */
public alien_round(id){
    for(new 
round 1round <= maxplayersround++){
        if(
is_user_alive(round)){
            
cs_set_user_team(roundCS_TEAM_CT)
        }
    }    
    new 
players[32], count
    get_players
(playerscount"a")
    if(
count){
        new 
iPlayer players[random(count)]
        new 
Float:AlienSpeed get_user_maxspeed(iPlayer) + 100.0
        
new name[32]
        
get_user_name(iPlayernamecharsmax(name))
        
        
cs_set_user_team(iPlayerCS_TEAM_T)
        
set_user_maxspeed(iPlayerAlienSpeed)
        
strip_user_weapons(iPlayer)
        
give_item(iPlayer"weapon_knife")
        
set_user_health(iPlayer5000)
        
set_hudmessage(025500.30.2006.05.0)
        
show_hudmessage(0"%L""ALIEN_ROUND")
    }
}
public 
soldier_round(id){
    for(new 
round 1round <= maxplayersround++){
        if(
is_user_alive(round)){
            
cs_set_user_team(roundCS_TEAM_T)
        }
    }    
    new 
players[32], count
    get_players
(playerscount"a")
    if(
count){
        new 
iPlayer players[random(count)]
        new 
name[32]
        
get_user_name(iPlayernamecharsmax(name))
        
        
cs_set_user_team(iPlayerCS_TEAM_CT)
        
strip_user_weapons(iPlayer)
        
set_user_health(iPlayer250)
        
give_item(iPlayer"weapon_knife")
        
give_item(iPlayer"weapon_deagle")
        
cs_set_user_bpammo(iPlayerCSW_DEAGLE1000)
        
give_item(iPlayer"weapon_m249")
        
cs_set_user_bpammo(iPlayerCSW_M2491000)
        
set_hudmessage(025500.30.2006.05.0)
        
show_hudmessage(0"%L""SOLDIER_ROUND")
    }
}
/* =============================== CLASSES =============================== */ 
fpA is offline
Send a message via Skype™ to fpA
 



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 19:45.


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