Raised This Month: $ Target: $400
 0% 

Blockmaker actions


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
boztroL
Member
Join Date: Feb 2011
Location: Tallinn, Estonia
Old 05-06-2011 , 16:04   Blockmaker actions
Reply With Quote #1

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 is offline
Send a message via MSN to boztroL
boztroL
Member
Join Date: Feb 2011
Location: Tallinn, Estonia
Old 05-10-2011 , 08:45   Re: Blockmaker actions
Reply With Quote #2

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
__________________
boztroL is offline
Send a message via MSN to boztroL
nnajko
Senior Member
Join Date: May 2009
Location: Sweden
Old 05-10-2011 , 14:46   Re: Blockmaker actions
Reply With Quote #3

Quote:
Originally Posted by boztroL View Post
How i need to 'mixup' them
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;

nnajko 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 04:20.


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