Raised This Month: $ Target: $400
 0% 

SEMICLIP that lasts only 10 seconds


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
upsasuke1
Junior Member
Join Date: Oct 2011
Old 10-22-2011 , 16:35   SEMICLIP that lasts only 10 seconds
Reply With Quote #1

I wanted a SEMICLIP that lasted just 10 seconds for Surf.

I hope by sma.
upsasuke1 is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 10-22-2011 , 17:22   Re: SEMICLIP that lasts only 10 seconds
Reply With Quote #2

When you want the semiclip? start of round? end of round?
Stereo is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 10-22-2011 , 17:30   Re: SEMICLIP that lasts only 10 seconds
Reply With Quote #3

Test is:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <engine>

new semiclip 1

public plugin_init() 
{
    
    
register_logevent("RoundStart",2,"1=Round_Start");
    
register_concmd("amx_semiclip","cmd_semiclip",FCVAR_SERVER)
    
register_clcmd("fullupdate""clcmd_fullupdate"
    
register_event("ResetHUD""ResetHUD""b")
    
register_event("HLTV""new_round""a""1=0""2=0")
}

public 
RoundStart()
{
    
set_task(0.1,"SemiClipOn")
    
set_task(10.1,"SemiClipOff")
}

public 
SemiClipOn()
{
    
server_cmd("amx_semiclip 1")
}

public 
SemiClipOff()
{
    
server_cmd("amx_semiclip 0")
}

public 
clcmd_fullupdate() 
{
    return 
PLUGIN_HANDLED_MAIN
}  

public 
cmd_semiclip(id,level,cid

    if(!
cmd_access(id,level,cid,2)) 
        return 
PLUGIN_HANDLED 
         
    
new arg1[32
    
read_argv(1,arg1,31
    new 
semiclip str_to_num(arg1
     
    new 
players[32], pnum  
    get_players
(players,pnum,"a")  
     
    if(
semiclip
    { 
        for(new 
i=0;i<pnum;++i
            
entity_set_int(iEV_INT_solidSOLID_TRIGGER
    } 
    else 
    { 
        for(new 
i=0;i<pnum;++i
            
entity_set_int(iEV_INT_solidSOLID_BBOX
    } 
    return 
PLUGIN_HANDLED 
}  

public 
ResetHUD(id) {
    if(
semiclip)
        
entity_set_int(idEV_INT_solidSOLID_TRIGGER)
    else if(!
semiclip)
        
entity_set_int(idEV_INT_solidSOLID_BBOX)
}

public 
new_round() {
    new 
players[32], pnum 
    get_players
(players,pnum,"a"
    
    if(
semiclip) {
        for(new 
i=0;i<pnum;++i) {
            
entity_set_int(iEV_INT_solidSOLID_TRIGGER)
        }
    }
    else if(!
semiclip) {
        for(new 
i=0;i<pnum;++i) {
            
entity_set_int(iEV_INT_solidSOLID_BBOX)
        }
    }
    return 
PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1046\\ f0\\ fs16 \n\\ par }
*/ 
Updated.
__________________

Last edited by kramesa; 10-22-2011 at 19:26.
kramesa is offline
upsasuke1
Junior Member
Join Date: Oct 2011
Old 10-22-2011 , 18:44   Re: SEMICLIP that lasts only 10 seconds
Reply With Quote #4

Tenks
upsasuke1 is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 10-22-2011 , 18:53   Re: SEMICLIP that lasts only 10 seconds
Reply With Quote #5

Optimize this:

PHP Code:
public cmd_semiclip(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED
        
    
new arg1[32]
    
read_argv(1,arg1,31)
    new 
semiclip str_to_num(arg1)
    
    new 
players[32], pnum 
    get_players
(players,pnum,"a"
    
    if(
semiclip)
    {
        for(new 
i=0;i<pnum;++i)
            
entity_set_int(iEV_INT_solidSOLID_TRIGGER)
    }
    else
    {
        for(new 
i=0;i<pnum;++i)
            
entity_set_int(iEV_INT_solidSOLID_BBOX)
    }
    return 
PLUGIN_HANDLED

Stereo is offline
kramesa
Veteran Member
Join Date: Feb 2011
Location: Brazil
Old 10-22-2011 , 19:24   Re: SEMICLIP that lasts only 10 seconds
Reply With Quote #6

Works? I dont tested this plugin.
__________________
kramesa is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 10-23-2011 , 09:10   Re: SEMICLIP that lasts only 10 seconds
Reply With Quote #7

You can modify this for semiclip instead of noclip. Not sure if you wanted the person to get semiclip at round start or manually via cmd. http://forums.alliedmods.net/showpos...3&postcount=19
__________________
Bugsy 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 03:44.


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