Raised This Month: $ Target: $400
 0% 

Please help me finish this freeze skill


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 12-27-2014 , 10:43   Re: Please help me finish this freeze skill
Reply With Quote #1

yes something like that exactly
xines is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 12-30-2014 , 14:37   Re: Please help me finish this freeze skill
Reply With Quote #2

Why does this not work barcardi?

PHP Code:
new Handle:g_hFreezeTimers[MAXPLAYERS +1];
public 
Freezez_OnPluginStart()
{
    
LoadTranslations("common.phrases"); // FindTarget require this
    
RegConsoleCmd("do_xfreezez"freeze"[SM]usage: do_xfreezez <userid> <time>");
}

public 
Action:freeze(clientargs)
{
    new 
String:buffer[MAX_NAME_LENGTH];
    
GetCmdArg(1buffersizeof(buffer)); //name userid steamid etc. etc.
    
Format(buffersizeof(buffer), "#%s"buffer);
    new 
victim FindTarget(clientbuffer_false);
    if( 
victim != -// Found target
    
{
        new 
MoveType:= (GetEntityMoveType(client));
        if(
== MOVETYPE_FLY)
        {
            
GetCmdArg(2buffersizeof(buffer)); // time
            
new Float:time StringToFloat(buffer);

            if( !(
1.0 <= time <= 300.0) ) // Time range
            
{
                
ReplyToCommand(client"Please, use time between 1.0 - 300.0");
                return 
Plugin_Handled;
            }

            if( 
g_hFreezeTimers[victim] != INVALID_HANDLE // Timer is running
            
{
                
KillTimer(g_hFreezeTimers[victim]);
                
g_hFreezeTimers[victim] = INVALID_HANDLE;
            }

            new 
Handle:datapack;
            
g_hFreezeTimers[victim] = CreateDataTimer(timetimer_freezedatapack);
            
WritePackCell(datapackvictim);
            
WritePackCell(datapackGetClientUserId(victim));
            
ResetPack(datapack);

            
SetEntityMoveType(victimMOVETYPE_NONE);
            
ReplyToCommand(client"Player %L freeze %0.2f"victimtime);
        }
        else if(
== MOVETYPE_WALK)
        {
            
GetCmdArg(2buffersizeof(buffer)); // time
            
new Float:time StringToFloat(buffer);

            if( !(
1.0 <= time <= 300.0) ) // Time range
            
{
                
ReplyToCommand(client"Please, use time between 1.0 - 300.0");
                return 
Plugin_Handled;
            }

            if( 
g_hFreezeTimers[victim] != INVALID_HANDLE // Timer is running
            
{
                
KillTimer(g_hFreezeTimers[victim]);
                
g_hFreezeTimers[victim] = INVALID_HANDLE;
            }

            new 
Handle:datapack;
            
g_hFreezeTimers[victim] = CreateDataTimer(timetimer_freezedatapack);
            
WritePackCell(datapackvictim);
            
WritePackCell(datapackGetClientUserId(victim));
            
ResetPack(datapack);

            
SetEntityMoveType(victimMOVETYPE_NONE);
            
ReplyToCommand(client"Player %L freeze %0.2f"victimtime);
        }
    }
    return 
Plugin_Handled;
}

public 
Action:timer_freeze(Handle:timerHandle:datapack)
{
    new 
index ReadPackCell(datapack);
    
g_hFreezeTimers[index] = INVALID_HANDLE// Clear timer handle when callback works.

    
new victim GetClientOfUserId(ReadPackCell(datapack));

    if( 
victim != && IsClientInGame(victim) && IsPlayerAlive(victim) ) // victim still in game
    
{
        
SetEntityMoveType(victimMOVETYPE_WALK);
    }
    
    return 
Plugin_Continue;

xines is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-30-2014 , 15:15   Re: Please help me finish this freeze skill
Reply With Quote #3

Quote:
Originally Posted by xines View Post
Why does this not work barcardi?
...
Because this callback not exist...
Code:
public Freezez_OnPluginStart()
{
__________________
Do not Private Message @me
Bacardi is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 12-30-2014 , 15:34   Re: Please help me finish this freeze skill
Reply With Quote #4

ahh i forgot to tell, i have it loaded into another .sp where i initialize the module
xines is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 01-06-2015 , 12:21   Re: Please help me finish this freeze skill
Reply With Quote #5

Hello, i tryed add a check for movmentcheck and the check itself is working as planned but if i spam the script command in console like 5 times in a row
it gets my movetype wrong and the script think im freezed so the script "saves" the movetype_none, then it turns on freeze on me, and when timer then stops counting it then switches my movetype again to movetype_none permanently causing me to be stuck.

If i just use this only once in console no spamming everything works, but due its attached to a shooting skill script, it fires everytime someone shoots at somebody causing the problem i talked about, PLEASE help me out on this anyone .


PHP Code:
new Handle:g_hFreezeTimers[MAXPLAYERS +1];
new 
MoveType:MovmentCheck;
public 
Freezez_OnPluginStart()
{
    
LoadTranslations("common.phrases"); // FindTarget require this
    
RegConsoleCmd("do_xfreezez"freeze"[SM]usage: do_xfreezez <userid> <time>"); 
}

public 
Action:freeze(clientargs)
{
    new 
String:buffer[MAX_NAME_LENGTH];
    
GetCmdArg(1buffersizeof(buffer)); //name userid steamid etc. etc.
    
Format(buffersizeof(buffer), "#%s"buffer);
    new 
victim FindTarget(clientbuffer_false);
    if( 
victim != -// Found target
    
{
        
GetCmdArg(2buffersizeof(buffer)); // time
        
new Float:time StringToFloat(buffer);

        if( !(
1.0 <= time <= 300.0) ) // Time range
        
{
            
ReplyToCommand(client"Please, use time between 1.0 - 300.0");
            return 
Plugin_Handled;
        }

        if( 
g_hFreezeTimers[victim] != INVALID_HANDLE // Timer is running
        
{
            
KillTimer(g_hFreezeTimers[victim]);
            
g_hFreezeTimers[victim] = INVALID_HANDLE;
        }

        new 
Handle:datapack;
        
g_hFreezeTimers[victim] = CreateDataTimer(timetimer_freezedatapack);
        
WritePackCell(datapackvictim);
        
WritePackCell(datapackGetClientUserId(victim));
        
ResetPack(datapack);
        
        
MovmentCheck GetEntityMoveType(victim);
        
SetEntityMoveType(victimMOVETYPE_NONE);
        
ReplyToCommand(client"Player %L freeze %0.2f"victimtime);
    }
    return 
Plugin_Handled;
}

public 
Action:timer_freeze(Handle:timerHandle:datapack)
{
    new 
index ReadPackCell(datapack);
    
g_hFreezeTimers[index] = INVALID_HANDLE// Clear timer handle when callback works.

    
new victim GetClientOfUserId(ReadPackCell(datapack));

    if( 
victim != && IsClientInGame(victim) && IsPlayerAlive(victim) ) // victim still in game
    
{
        
SetEntityMoveType(victimMovmentCheck);
    }
    
    return 
Plugin_Continue;

xines is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 01-06-2015 , 12:59   Re: Please help me finish this freeze skill
Reply With Quote #6

Quote:
Originally Posted by xines View Post
Hello, i tryed add a check for movmentcheck and the check itself is working as planned but if i spam the script command in console like 5 times in a row
it gets my movetype wrong and the script think im freezed so the script "saves" the movetype_none, then it turns on freeze on me, and when timer then stops counting it then switches my movetype again to movetype_none permanently causing me to be stuck.

If i just use this only once in console no spamming everything works, but due its attached to a shooting skill script, it fires everytime someone shoots at somebody causing the problem i talked about, PLEASE help me out on this anyone .


PHP Code:
new Handle:g_hFreezeTimers[MAXPLAYERS +1];
new 
MoveType:MovmentCheck;
public 
Freezez_OnPluginStart()
{
    
LoadTranslations("common.phrases"); // FindTarget require this
    
RegConsoleCmd("do_xfreezez"freeze"[SM]usage: do_xfreezez <userid> <time>"); 
}

public 
Action:freeze(clientargs)
{
    new 
String:buffer[MAX_NAME_LENGTH];
    
GetCmdArg(1buffersizeof(buffer)); //name userid steamid etc. etc.
    
Format(buffersizeof(buffer), "#%s"buffer);
    new 
victim FindTarget(clientbuffer_false);
    if( 
victim != -// Found target
    
{
        
GetCmdArg(2buffersizeof(buffer)); // time
        
new Float:time StringToFloat(buffer);

        if( !(
1.0 <= time <= 300.0) ) // Time range
        
{
            
ReplyToCommand(client"Please, use time between 1.0 - 300.0");
            return 
Plugin_Handled;
        }

        if( 
g_hFreezeTimers[victim] != INVALID_HANDLE // Timer is running
        
{
            
KillTimer(g_hFreezeTimers[victim]);
            
g_hFreezeTimers[victim] = INVALID_HANDLE;
        }

        new 
Handle:datapack;
        
g_hFreezeTimers[victim] = CreateDataTimer(timetimer_freezedatapack);
        
WritePackCell(datapackvictim);
        
WritePackCell(datapackGetClientUserId(victim));
        
ResetPack(datapack);
        
        
MovmentCheck GetEntityMoveType(victim);
        
SetEntityMoveType(victimMOVETYPE_NONE);
        
ReplyToCommand(client"Player %L freeze %0.2f"victimtime);
    }
    return 
Plugin_Handled;
}

public 
Action:timer_freeze(Handle:timerHandle:datapack)
{
    new 
index ReadPackCell(datapack);
    
g_hFreezeTimers[index] = INVALID_HANDLE// Clear timer handle when callback works.

    
new victim GetClientOfUserId(ReadPackCell(datapack));

    if( 
victim != && IsClientInGame(victim) && IsPlayerAlive(victim) ) // victim still in game
    
{
        
SetEntityMoveType(victimMovmentCheck);
    }
    
    return 
Plugin_Continue;

After freeze has ended set player movetype to movetype_walk
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 01-06-2015 , 13:48   Re: Please help me finish this freeze skill
Reply With Quote #7

if player got movetype_fly, setting this to walk after freeze will cause player to fall, thats why i use movement check
xines is offline
Michalplyoutube
Veteran Member
Join Date: Jan 2013
Location: Tank Carrier in Mannhatt
Old 01-06-2015 , 14:31   Re: Please help me finish this freeze skill
Reply With Quote #8

Quote:
Originally Posted by xines View Post
if player got movetype_fly, setting this to walk after freeze will cause player to fall, thats why i use movement check
Because without knowing it I can guess its noclip move type
__________________
The plugin developer of TF2BWR Reborn
And a TF2 Player
Michalplyoutube is offline
xines
Veteran Member
Join Date: Aug 2013
Location: Denmark
Old 01-06-2015 , 14:54   Re: Please help me finish this freeze skill
Reply With Quote #9

whats noclip movetype, i do not understand what your trying to explain O.o
xines is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 01-06-2015 , 15:26   Re: Please help me finish this freeze skill
Reply With Quote #10

Quote:
Originally Posted by xines View Post
whats noclip movetype, i do not understand what your trying to explain O.o
PHP Code:
MOVETYPE_NONE       Never moves (normal prop_static behavior
MOVETYPE_ISOMETRIC  For players 
MOVETYPE_WALK       Player only 
moving on the ground 
MOVETYPE_STEP       Gravity
special edge handling -- monsters use this 
MOVETYPE_FLY        No gravity
but still collides with stuff 
MOVETYPE_FLYGRAVITY Flies through the air 
is affected by gravity 
MOVETYPE_VPHYSICS   Uses VPHYSICS 
for simulation (normal prop_physics behavior
MOVETYPE_PUSH       No clip to worldpush and crush 
MOVETYPE_NOCLIP     No gravity
no collisionsstill do velocity/avelocity 
MOVETYPE_LADDER     Used by players only when going onto a ladder 
MOVETYPE_OBSERVER   Observer movement
depends on players observer mode 
MOVETYPE_CUSTOM     Allows the entity to describe its own physics 
Movetypes that exist in source engine...
__________________
...

Last edited by Oshizu; 01-06-2015 at 15:29.
Oshizu 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 13:28.


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