Raised This Month: $202 Target: $400
 50% 

I wanna some plugin for my knife server


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
husam124
Member
Join Date: Jul 2017
Location: Palestine
Old 01-10-2021 , 04: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.
__________________
The Best Plugin Maker
husam124 is offline
husam124
Member
Join Date: Jul 2017
Location: Palestine
Old 01-10-2021 , 13: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
__________________
The Best Plugin Maker
husam124 is offline
thEsp
Veteran Member
Join Date: Aug 2017
Location: Land of Eagles
Old 01-10-2021 , 15: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 06:22.
thEsp is offline
husam124
Member
Join Date: Jul 2017
Location: Palestine
Old 01-11-2021 , 03:39   Re: I wanna some plugin for my knife server
Reply With Quote #4

ty i will give it a try
__________________
The Best Plugin Maker
husam124 is offline
husam124
Member
Join Date: Jul 2017
Location: Palestine
Old 01-11-2021 , 03: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
__________________
The Best Plugin Maker
husam124 is offline
thEsp
Veteran Member
Join Date: Aug 2017
Location: Land of Eagles
Old 01-11-2021 , 06: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
Member
Join Date: Jul 2017
Location: Palestine
Old 01-11-2021 , 08: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
__________________
The Best Plugin Maker
husam124 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-11-2021 , 09: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.6 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Last edited by Natsheh; 01-12-2021 at 12:34.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
husam124
Member
Join Date: Jul 2017
Location: Palestine
Old 01-11-2021 , 09: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
__________________
The Best Plugin Maker
husam124 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-11-2021 , 09:32   Re: I wanna some plugin for my knife server
Reply With Quote #10

code updated.

iPlayer => iTargetPlayer
__________________
@Jailbreak Main Mod v2.6 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


Thread Tools
Display Modes

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 20:30.


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