AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Blockmaker actions (https://forums.alliedmods.net/showthread.php?t=156451)

boztroL 05-06-2011 16:04

Blockmaker actions
 
Hi!

I need to actions to my blockmaker:
  1. I need one action to my blockmaker. Block type is 'Delayed Ice' (You're moving on it like on ice block, but it will dissapear). The 'Delay Before Dissapear' is property 1
  2. Weapon action whick gives you random weapon (colt, ak47, m3, xm1014 or mp5) with one bullet

boztroL 05-10-2011 08:45

Re: Blockmaker actions
 
HTML Code:

ActionIce(id)
{
        if ( !g_ice[id] )
        {
                entity_set_float(id, EV_FL_friction, 0.15);
                entity_set_float(id, EV_FL_maxspeed, 400.0);
               
                g_ice[id] = true;
        }
       
        new task_id = TASK_ICE + id;
        if ( task_exists(task_id) ) remove_task(task_id);
       
        set_task(0.1, "TaskNotOnIce", task_id);
}

HTML Code:

ActionDelayedBhop(ent)
{
        if ( task_exists(TASK_SOLIDNOT + ent)
        || task_exists(TASK_SOLID + ent) ) return PLUGIN_HANDLED;
       
        static property1[5];
        GetProperty(ent, 1, property1);
       
        set_task(str_to_float(property1), "TaskSolidNot", TASK_SOLIDNOT + ent);
       
        return PLUGIN_HANDLED;
}

How i need to 'mixup' them :D

nnajko 05-10-2011 14:46

Re: Blockmaker actions
 
Quote:

Originally Posted by boztroL (Post 1466771)
How i need to 'mixup' them :D

Try this
PHP Code:

ActionDelayedIce(idiEnt)
{
    new 
iTask TASK_SOLIDNOT iEnt;
    if( 
task_exists(iTask) || task_exists(TASK_SOLID iEnt) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    if( !
g_ice[id] )
    {
        
entity_set_float(idEV_FL_friction0.15);
        
entity_set_float(idEV_FL_maxspeed400.0);
        
        
g_ice[id] = true;
    }
    
    
iTask TASK_ICE id;
    if( 
task_exists(iTask) )
    {
        
remove_task(iTask);
    }
    
    
set_task(0.1"TaskNotOnIce"iTask);
    
    static 
szProp[5];
    
GetProperty(iEnt1szProp);
    
    new 
Float:flValue str_to_float(szProp);
    
    
iTask TASK_SOLIDNOT iEnt;
    
set_task(str_to_float(flValue), "TaskSolidNot"iTask);
    
    return 
PLUGIN_HANDLED;




All times are GMT -4. The time now is 04:20.

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