This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Blockmaker - How to use less actions in your bm


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lazarev
Veteran Member
Join Date: Sep 2008
Old 03-04-2010 , 05:59   Blockmaker - How to use less actions in your bm
Reply With Quote #1

Hello,
Here I will show you, how to make normal/low/high trampoline with one action instead of three different
Here is the action:
PHP Code:
actionTrampoline(idFloat:Velo)
{
    
//if trampoline timeout has exceeded (needed to prevent velocity being given multiple times)
    
if (halflife_time() >= gfTrampolineTimeout[id])
    {
        new 
Float:velocity[3];
        
        
//set player Z velocity to make player bounce
        
entity_get_vector(idEV_VEC_velocityvelocity);
        
velocity[2] = Velo;    
        
entity_set_vector(idEV_VEC_velocityvelocity);
        
        
entity_set_int(idEV_INT_gaitsequence6);           //play the Jump Animation
        
        
gfTrampolineTimeout[id] = halflife_time() + 0.5;
    }

Velo = speed of trampoline.

So, we will have something like this:
PHP Code:
    case BM_TRAMPOLINEactionTrampoline(id500.0);
    case 
BM_LOWTRAMPOLINEactionTrampoline(id250.0);
    case 
BM_HIGHTRAMPOLINEactionTrampoline(id750.0); 
Tell me if you want more examples, oki?

Last edited by lazarev; 03-30-2010 at 13:59.
lazarev is offline
JaGareN
Senior Member
Join Date: Mar 2009
Old 03-04-2010 , 15:56   Re: Blockmaker - How to use one action for blocks like normal/high/low trampoline
Reply With Quote #2

Quote:
Originally Posted by lazarev View Post

So, we will have something like this:
PHP Code:
    case BM_TRAMPOLINEactionTrampoline(id500.0);
    case 
BM_LOWTRAMPOLINEactionTrampoline(id250.0);
    case 
BM_HIGHTRAMPOLINEactionTrampoline(id750.0); 
Tell me if you want more examples, oki?

You should explain where they have to put those. Let me guess... under client_prethink?
JaGareN is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 03-05-2010 , 04:22   Re: Blockmaker - How to use one action for blocks like normal/high/low trampoline
Reply With Quote #3

sure.
lazarev is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 03-06-2010 , 03:40   Re: Blockmaker - How to use one action for blocks like normal/high/low trampoline
Reply With Quote #4

Money & Super money in one.
PHP Code:
    case BM_MONEYactionMoney(idfalse5000);
    case 
BM_SUPERMONEYactionMoney(idfalse9000); 
PHP Code:
actionMoney(idOverrideTimer, const givemoney)
{
    new 
Float:fTime halflife_time();
    
    
//make sure player is alive
    
if (fTime >= gfMoneyNextUse[id] || OverrideTimer)
    {
            new 
money cs_get_user_money(id);
            if( 
money 16000 )
            {
                if( 
money >= (16000 givemoney) )    
                {
                    
cs_set_user_money(id16000);
                }
                else     
                {
                    
cs_set_user_money(idmoney givemoney);
                }
                
gfMoneyNextUse[id] = fTime get_cvar_float("bm_moneycooldown");
            }
        }
    }


Last edited by lazarev; 03-06-2010 at 04:14.
lazarev is offline
fredde123321
Junior Member
Join Date: Mar 2010
Old 03-22-2010 , 17:31   Re: Blockmaker - How to use one action for blocks like normal/high/low trampoline
Reply With Quote #5

Thanks, very useful
fredde123321 is offline
lazarev
Veteran Member
Join Date: Sep 2008
Old 03-30-2010 , 13:46   Re: Blockmaker - How to use one action for blocks like normal/high/low trampoline
Reply With Quote #6

grenade blocks:
PHP Code:
case BM_HEactionGrenade(idCSW_HEGRENADE);
case 
BM_FROSTactionGrenade(idCSW_SMOKEGRENADE);
case 
BM_FLASHactionGrenade(idCSW_FLASHBANG); 
PHP Code:
actionGrenade(idGrenadeType)
{
    
//get game time
    
new Float:fTime halflife_time();
        
    if (
cs_get_user_team id ) == CS_TEAM_T)
    {
        switch( 
GrenadeType )
        {
            case 
CSW_FLASHBANG:
            {
                if(
fTime >= gfFlashNextUse[id])
                {
                    
give_item(id"weapon_flashbang");
                    
gfFlashNextUse[id] = fTime get_cvar_float("bm_flashcooldown"); 
                }
            }
            case 
CSW_HEGRENADE:
            {
                if(
fTime >= gfHENextUse[id ])
                {
                    
give_item(id"weapon_hegrenade");
                    
gfHENextUse[id] = fTime get_cvar_float("bm_hecooldown"); 
                }
            }
            case 
CSW_SMOKEGRENADE:
            {
                if(
fTime >= gfFrostNextUse[id])
                {
                    
give_item(id"weapon_smokegrenade");
                    
gfFrostNextUse[id] = fTime get_cvar_float("bm_frostcooldown");
                }
            }
        }
    }

lazarev 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 #7

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 #8

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
r14170
Veteran Member
Join Date: Dec 2009
Old 04-06-2010 , 08:26   Re: Blockmaker - How to use less actions in your bm
Reply With Quote #9

asdasd

Last edited by r14170; 08-12-2011 at 11:23.
r14170 is offline
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 #10

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
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 05:58.


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