View Single Post
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 03-17-2020 , 12:08   Re: [ANY] Dev Cmds (1.8) [02-Mar-2020]
Reply With Quote #25

PHP Code:
public Action StopAngle(int clientint args)
{
    ...
            
CreateTimer(0.1Time_StopAngledpTIMER_FLAG_NO_MAPCHANGE TIMER_HNDL_CLOSE);

Isn't TIMER_REPEAT required here or something...
Also, missing return Plugin_Handled;

I found sometimes "sm_ice" very requested command.

PHP Code:
RegAdminCmd("sm_ice",        CmdFreeze,        ADMFLAG_ROOT"<entity> (optional). Freeze / unfreeze aim target or specified entity.");

...

public 
Action CmdFreeze(int clientint args)
{
    
char sEnt[16];
    
int target;
    
    if( 
args )
    {
        
GetCmdArg(1sEntsizeof sEnt);
        
target StringToInt(sEnt);
        if( !
IsValidEntity(target) )
        {
            
PrintToChat(client"Entity %i is invalid."target);
            return 
Plugin_Handled;
        }
    }
    else {
        
target GetClientAimTarget(clientfalse);
        if( 
target )
        {
            
PrintToChat(client"Entity is not aimed.");
            return 
Plugin_Handled;
        }
    }
    
    if ( !
HasEntProp(targetProp_Send"movetype") )
    {
        
PrintToChat(client"Entity %i cannot be freezed."target);
    }
    else {
        
int mt GetEntProp(targetProp_Send"movetype");
        
        if ( 
mt == view_as<int>(MOVETYPE_NONE) )
        {
            
SetEntProp(targetProp_Send"movetype"MOVETYPE_WALK);
            
PrintToChat(client"Entity %i is un-freezed."target);
        }
        else {
            
SetEntProp(targetProp_Send"movetype"MOVETYPE_NONE);
            
PrintToChat(client"Entity %i is freezed."target);
        }
    }
    return 
Plugin_Handled;

I noticed sourcemod already has sm_freeze in funcommands.sp, but it is not convenient:
Code:
sm_freeze <#userid|name> [time]
- it does not allow aim target
- it does not allow target non-client entity
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline