View Single Post
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