PHP Code:
public Action StopAngle(int client, int args)
{
...
CreateTimer(0.1, Time_StopAngle, dp, TIMER_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 client, int args)
{
char sEnt[16];
int target;
if( args > 0 )
{
GetCmdArg(1, sEnt, sizeof sEnt);
target = StringToInt(sEnt);
if( !IsValidEntity(target) )
{
PrintToChat(client, "Entity %i is invalid.", target);
return Plugin_Handled;
}
}
else {
target = GetClientAimTarget(client, false);
if( target < 0 )
{
PrintToChat(client, "Entity is not aimed.");
return Plugin_Handled;
}
}
if ( !HasEntProp(target, Prop_Send, "movetype") )
{
PrintToChat(client, "Entity %i cannot be freezed.", target);
}
else {
int mt = GetEntProp(target, Prop_Send, "movetype");
if ( mt == view_as<int>(MOVETYPE_NONE) )
{
SetEntProp(target, Prop_Send, "movetype", MOVETYPE_WALK);
PrintToChat(client, "Entity %i is un-freezed.", target);
}
else {
SetEntProp(target, Prop_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
__________________