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

Blockmaker - How to use less actions in your bm


Post New Thread Reply   
 
Thread Tools Display Modes
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 04-08-2010 , 07:48   Re: Blockmaker - How to use less actions in your bm
Reply With Quote #11

Quote:
Originally Posted by r14170 View Post
can you make 1 action with awp , deagle , usp , glock , m4a1 , ak47 , m3 ?
Yes its possible.
__________________
Retired.
Xalus is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 04-08-2010 , 08:00   Re: Blockmaker - How to use one action for blocks like normal/high/low trampoline
Reply With Quote #12

Try this
Untested!


Gun blocks:

PHP Code:
case BM_AWPactionGun(idCSW_AWP);
case 
BM_DEAGLEactionGun(idCSW_DEAGLE);
case 
BM_M4A1actionGun(idCSW_M4A1); 
PHP Code:
actionGun(idGunType)
{
    
//get game time
    
new Float:fTime halflife_time();
        
    if (
cs_get_user_team id ) == CS_TEAM_T)
    {
        switch( 
GunType )
        {
            case 
CSW_AWP:
            {
                if(
fTime >= gfAwpNextUse[id])
                {
                    if(
user_has_weapon(idCSW_AWP))
                        return 
PLUGIN_HANDLED
                    
                    
// Give 3 bullets
                    
new awpboy give_item(id"weapon_awp");
                    
cs_set_weapon_ammo(awpboy3)
                    
                    
give_item(id"weapon_awp");
                    
cs_set_user_bpammo(idCSW_AWP0)
                    
                    
gfAwpNextUse[id] = fTime get_cvar_float("bm_awpcooldown"); 
                }
            }
            case 
CSW_DEAGLE:
            {
                if(
fTime >= gfDeagleNextUse[id ])
                {
                    if(
user_has_weapon(idCSW_DEAGLE))
                        return 
PLUGIN_HANDLED
                    
                    
// Give 3 bullets
                    
new deagleboy give_item(id"weapon_deagle");
                    
cs_set_weapon_ammo(deagleboy3)
                    
                    
give_item(id"weapon_deagle");
                    
cs_set_user_bpammo(idCSW_DEAGLE0)
                    
                    
gfDeagleNextUse[id] = fTime get_cvar_float("bm_deaglecooldown"); 
                }
            }
            case 
CSW_M4A1:
            {
                if(
fTime >= gfM4a1NextUse[id])
                {
                    if(
user_has_weapon(idCSW_M4A1))
                        return 
PLUGIN_HANDLED
                    
                    
// Give 3 bullets
                    
new m4a1boy give_item(id"weapon_m4a1");
                    
cs_set_weapon_ammo(m4a1boy3)
                    
                    
give_item(id"weapon_m4a1");
                    
cs_set_user_bpammo(idCSW_M4A10)
                    
                    
gfM4a1NextUse[id] = fTime get_cvar_float("bm_m4a1cooldown"); 
                }
            }
        }
    }

__________________
Retired.
Xalus is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-08-2010 , 12:50   Re: Blockmaker - How to use one action for blocks like normal/high/low trampoline
Reply With Quote #13

Quote:
Originally Posted by Xalus View Post
Try this
Untested!
How redundant.

PHP Code:
new Float:g_fWeaponNextUse[33][CSW_P90 1]; 
PHP Code:
// reset
for(new CSW_P228<= CSW_P90i++)
    
g_fWeaponNextUse[id][i] = 0.0
PHP Code:
case BM_AWPactionGun(idCSW_AWP10);
case 
BM_DEAGLEactionGun(idCSW_DEAGLE30);
case 
BM_M4A1actionGun(idCSW_M4A111); 
PHP Code:
actionGun(idweaponIDclipAmmobpAmmo)
{
    
//get game time
    
new Float:fTime halflife_time();
    if(
g_fWeaponNextUse[id][weaponID] > fTime)
        return;
        
    if (
cs_get_user_team id ) == CS_TEAM_T)
    {
        if(
user_has_weapon(idweaponID))
            return
        
        new 
weaponName[20]
        if(!
get_weaponname(weaponIDweaponNamecharsmax(weaponName))
            return
        
        new 
entity give_item(idweaponName)
        
cs_set_weapon_ammo(entityclipAmmo)
        
cs_set_user_bpammo(idweaponIDbpAmmo)
        
        
g_fWeaponNextUse[id][weaponID] = fTime 30.0;
    }

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 04-10-2010 , 21:57   Re: Blockmaker - How to use less actions in your bm
Reply With Quote #14

Hmm, ye.
Better coded xD
__________________
Retired.
Xalus is offline
gastyc
Junior Member
Join Date: Sep 2009
Old 05-18-2011 , 21:52   Re: Blockmaker - How to use less actions in your bm
Reply With Quote #15

magic carpet please
BM by necro
thank
gastyc is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 05-24-2011 , 12:27   Re: Blockmaker - How to use less actions in your bm
Reply With Quote #16

Quote:
Originally Posted by gastyc View Post
magic carpet please
BM by necro
thank
not related to the thread
lazarev is offline
Erox902
Veteran Member
Join Date: Jun 2009
Location: Never Never Land
Old 09-10-2011 , 21:18   Re: Blockmaker - How to use less actions in your bm
Reply With Quote #17

Figured this could use some updating

Faster and slower heals:
example:
PHP Code:
case BM_SLOW_HEALER:actionHeal(id0.7)
case 
BM_HEALER:actionHeal(id0.5)
case 
BM_FAST_HEALER:actionHeal(id0.2)
...........
actionHeal(idFloat:Next)
{
    if (
halflife_time() >= gfNextHealTime[id])
    {
        new 
hp get_user_health(id);
        new 
amount get_pcvar_num(gHealamount);
        new 
sum = (hp amount);
        
        if (
hp 100)
        {
            return 
PLUGIN_CONTINUE;
        }
        else if (
sum 100)
        {
            
set_user_health(idsum);
        }
        else
        {
            
set_user_health(id100);
        }
        
        
gfNextHealTime[id] = halflife_time() + Next;
    }
    
    return 
PLUGIN_CONTINUE;

-----------------------------------------------
Shorter and longer speedboosts:
example:
PHP Code:
case BM_SB_SHORT:actionSpeedBoost(id550)
case 
BM_SB_MED:actionSpeedBoost(id800)
case 
BM_SB_LONG:actionSpeedBoost(id950)
........
actionSpeedBoost(idSpeed)
{
    
//if speed boost timeout has exceeded (needed to prevent speed boost being given multiple times)
    
if (halflife_time() >= gfSpeedBoostTimeOut[id])
    {
        new 
Float:pAim[3];
        
        
//set velocity on player in direction they're aiming
        
velocity_by_aim(idSpeedpAim);
        
pAim[2] = 260.0;                    //make sure Z velocity is only as high as a jump
        
entity_set_vector(idEV_VEC_velocitypAim);
        
        
entity_set_int(idEV_INT_gaitsequence6);           //play the Jump Animation
        
        
gfSpeedBoostTimeOut[id] = halflife_time() + 0.5;
    }

---------------------------------------------
Lower and higher gravity:
example:
PHP Code:
case BM_GRAVITY:actionLowGravity(id0.6)
case 
BM_LOWGRAVITY:actionLowGravity(id0.4)
case 
BM_LOWERGRAVITY:actionLowGravity(id0.25)
........
actionLowGravity(idFloat:Gravity)
{
    
//set player to have low gravity
    
set_user_gravity(idGravity);
    
    
//set global boolean showing player has low gravity
    
gbLowGravity[id] = true;

--------------------------------------------
More and less damage:
example:
PHP Code:
case BM_DAMAGE:actionDamage(id5.0)
case 
BM_DAMAGE_X2:actionDamage(id10.0)
.......
actionDamage(idFloat:amount)
{
    if (
halflife_time() >= gfNextDamageTime[id])
    {
        if (
get_user_health(id) > 0)
        {
            
fakedamage(id"damage block"amountDMG_CRUSH);
        }
        
        
gfNextDamageTime[id] = halflife_time() + 0.5;
    }

Erox902 is offline
Reply


Thread Tools
Display Modes

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 01:02.


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