Raised This Month: $51 Target: $400
 12% 

I wanna some plugin for my knife server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 01-10-2021 , 03:13   I wanna some plugin for my knife server
Reply With Quote #1

i want a plugin that when an admin says /freeze, it freezes all nearby enemies by specific range for 5 secs then it unfreezes them.
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 01-10-2021 , 12:59   Re: I wanna some plugin for my knife server
Reply With Quote #2

i want it like this plugin https://forums.alliedmods.net/showth...ighlight=frost
but it doesnt freeze when someone throw nade but it freezes when an admin type /freeze
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
thEsp
BANNED
Join Date: Aug 2017
Old 01-10-2021 , 14:42   Re: I wanna some plugin for my knife server
Reply With Quote #3

Code:
#include <amxmodx> #include <fakemeta> #define FREEZE_RADIUS 0 #define FREEZE_TIME 5.0 #define ACCESS_FLAG ADMIN_BAN #define VALID_PLAYER<%1> (0 < %1 && %1 < 33) public plugin_init() {     register_clcmd("say /freeze", "OnCmd_SaySlashFreeze"); } public OnCmd_SaySlashFreeze(iPlayer) {     if (!(get_user_flags(iPlayer) & ACCESS_FLAG))         return PLUGIN_CONTINUE;     new iTargetPlayer = -1, Float:fPlayerPosition[3];     pev(iPlayer, pev_origin, fPlayerPosition);         while ((iTargetPlayer = engfunc(EngFunc_FindEntityInSphere, iTargetPlayer, fPlayerPosition, FREEZE_RADIUS)) != 0)     {         if (VALID_PLAYER<iTargetPlayer> && iTargetPlayer != iPlayer && is_user_alive(iTargetPlayer) /* Not sure if necessary. */)         {             set_pev(iPlayer, pev_flags, pev(iPlayer, pev_flags) | FL_FROZEN);             set_task(FREEZE_TIME, "OnTsk_ThawPlayer", iTargetPlayer);         }     }         return PLUGIN_HANDLED; } public OnTsk_ThawPlayer(iPlayer) {     set_pev(iPlayer, pev_flags, pev(iPlayer, pev_flags) & ~FL_FROZEN); }

This might do the job, I think.

Last edited by thEsp; 01-11-2021 at 05:22.
thEsp is offline
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 01-11-2021 , 02:39   Re: I wanna some plugin for my knife server
Reply With Quote #4

ty i will give it a try
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 01-11-2021 , 02:50   Re: I wanna some plugin for my knife server
Reply With Quote #5

Quote:
Originally Posted by thEsp View Post
Code:
#include <amxmodx> #include <fakemeta> #define FREEZE_RADIUS 0 #define FREEZE_TIME 5.0 #define ACCESS_FLAG ADMIN_BAN #define VALID_PLAYER<%1> (0 < %1 && %1 < 33) public plugin_init() {     register_clcmd("say /freeze", "OnCmd_SaySlashFreeze"); } public OnCmd_SaySlashFreeze(iPlayer) {     if (!(get_user_flags(iPlayer) & ACCESS_FLAG))         return PLUGIN_CONTINUE;     new iTargetPlayer = -1, Float:fPlayerPosition[3];     pev(iPlayer, pev_origin, fPlayerPosition);         while ((iTargetPlayer = engfunc(EngFunc_FindEntityInSphere, iTargetPlayer, fPlayerPosition, FREEZE_RADIUS)) != 0)     {         if (VALID_PLAYER<iTargetPlayer> && is_user_alive(iTargetPlayer) /* Not sure if necessary. */)         {             set_pev(iPlayer, pev_flags, pev(iPlayer, pev_flags) | FL_FROZEN);             set_task(FREEZE_TIME, "OnTsk_ThawPlayer", iTargetPlayer);         }     }         return PLUGIN_HANDLED; } public OnTsk_ThawPlayer(iPlayer) {     set_pev(iPlayer, pev_flags, pev(iPlayer, pev_flags) & ~FL_FROZEN); }

This might do the job, I think.
it is great but it is only one problem that it freezes the admin him self not the players around him
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
thEsp
BANNED
Join Date: Aug 2017
Old 01-11-2021 , 05:24   Re: I wanna some plugin for my knife server
Reply With Quote #6

I've edited my previous answer. Also configure FREEZE_RADIUS.
thEsp is offline
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 01-11-2021 , 07:43   Re: I wanna some plugin for my knife server
Reply With Quote #7

Quote:
Originally Posted by thEsp View Post
I've edited my previous answer. Also configure FREEZE_RADIUS.
idk why but it has no effects at all it does not freezes the enemies
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-11-2021 , 08:05   Re: I wanna some plugin for my knife server
Reply With Quote #8

PHP Code:
#include <amxmodx>
#include <fakemeta>

#define FREEZE_RADIUS 300.0
#define FREEZE_TIME 5.0
#define ACCESS_FLAG ADMIN_BAN

public plugin_init()
{
    
register_clcmd("say /freeze""OnCmd_SaySlashFreeze");
}

public 
OnCmd_SaySlashFreeze(iPlayer)
{
    if (!(
get_user_flags(iPlayer) & ACCESS_FLAG))
        return 
PLUGIN_CONTINUE;

    new 
iTargetPlayer = -1iPlayerTeam get_user_team(iPlayer), Float:fPlayerPosition[3], iFrozeni_aFrozen[32];
    
pev(iPlayerpev_originfPlayerPosition);
    
    while ((
iTargetPlayer engfunc(EngFunc_FindEntityInSphereiTargetPlayerfPlayerPositionFREEZE_RADIUS)) != 0)
    {
        if (
is_user_alive(iTargetPlayer)  && iPlayerTeam  != get_user_team(iTargetPlayer))
        {
            
set_pev(iTargetPlayerpev_flagspev(iTargetPlayerpev_flags) | FL_FROZEN);
            
i_aFrozen[iFrozen ++] = iTargetPlayer;
        }
    }
    
    if(
iFrozen  0set_task(FREEZE_TIME"OnTsk_ThawPlayer"iFrozeni_aFrozenstrlen(i_aFrozen));
    return 
PLUGIN_HANDLED;
}

public 
OnTsk_ThawPlayer(i_aPlayers[], iFrozen)
{
    for(new 
iiPlayeriFrozeni++)
    {
         
iPlayer i_aPlayers];

         
set_pev(iPlayerpev_flagspev(iPlayerpev_flags) & ~FL_FROZEN);
    }


Quote:
Originally Posted by husam124 View Post
idk why but it has no effects at all it does not freezes the enemies
you need to set a float value for the freeze radius.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 01-12-2021 at 11:34.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
husam124
BANNED
Join Date: Jul 2017
Location: Usa
Old 01-11-2021 , 08:24   Re: I wanna some plugin for my knife server
Reply With Quote #9

Quote:
Originally Posted by Natsheh View Post
PHP Code:
#include <amxmodx>
#include <fakemeta>

#define FREEZE_RADIUS 300.0
#define FREEZE_TIME 5.0
#define ACCESS_FLAG ADMIN_BAN

public plugin_init()
{
    
register_clcmd("say /freeze""OnCmd_SaySlashFreeze");
}

public 
OnCmd_SaySlashFreeze(iPlayer)
{
    if (!(
get_user_flags(iPlayer) & ACCESS_FLAG))
        return 
PLUGIN_CONTINUE;

    new 
iTargetPlayer = -1iPlayerTeam get_user_team(iPlayer), Float:fPlayerPosition[3], iFrozeni_aFrozen[32];
    
pev(iPlayerpev_originfPlayerPosition);
    
    while ((
iTargetPlayer engfunc(EngFunc_FindEntityInSphereiTargetPlayerfPlayerPositionFREEZE_RADIUS)) != 0)
    {
        if (
is_user_alive(iTargetPlayer)  && iPlayerTeam  != get_user_team(iTargetPlayer))
        {
            
set_pev(iPlayerpev_flagspev(iPlayerpev_flags) | FL_FROZEN);
            
i_aFrozen[iFrozen ++] = iTargetPlayer;
        }
    }
    
    if(
iFrozen  0set_task(FREEZE_TIME"OnTsk_ThawPlayer"iFrozeni_aFrozenstrlen(i_aFrozen));
    return 
PLUGIN_HANDLED;
}

public 
OnTsk_ThawPlayer(i_aPlayers[], iFrozen)
{
    for(new 
iiPlayeriFrozeni++)
    {
         
iPlayer i_aPlayers];
         if(!
is_user_alive(iPlayer)) continue;
         
set_pev(iPlayerpev_flagspev(iPlayerpev_flags) & ~FL_FROZEN);
    }




you need to set a value for the freeze radius.
well it does freezes me instead of my enemies
husam124 is offline
Send a message via ICQ to husam124 Send a message via AIM to husam124 Send a message via Yahoo to husam124 Send a message via Skype™ to husam124
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-11-2021 , 08:32   Re: I wanna some plugin for my knife server
Reply With Quote #10

code updated.

iPlayer => iTargetPlayer
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 09:34.


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