-
Freeze-Unfreeze
İsteği söyleyeyim, amx_freeze @T 123 yapinca 123 saniye 9999999999999 yapinca yazdığım rakama göre freeze yapıcak.
amx_freeze pit10 5 mesela... bu şekildede olsun
amx_unfreeze @T yaptığımda direk eski hallerine geri dönücekler
bide ufak mavi bi glow verilirse (y)
Freeze atınca nolucak
@T yada nick yazınca komutun uygulandığı kişi gömülmeyecek sabitlenicek yani hareket edemeyecek atıyorum sağa sola koşamayacak, ama bi cvar komutuyla faresini hareket ettir,ettirme, attack yapsın, yapmasın, cvarı eklenebilir
Bu alliedmoddersda bulduğum plugin;
PHP- Kodu:
/* Aim Freeze v0.0.3 by Devil
* Description : An admin (flag definable), which have bind a key for using "freeze" command, can aim a player and freeze/unfreeze him.
A freezed player cannot move, shot, [ jump , take weapons (excepted knife) , and move mouse ] ( [ ] -> definable by cvar )
* Cvars : af_distance < value > - Distance max between aimer and aimed (default : 400)
af_allow_mouse < value > - 1 : allow move mouse ; 0 : not allow move mouse
af_only_knife < value > - 1 : allow only knife ; 0 : allow all weapons
af_allow_jump < value > - 1 : allow jump ; 0 : not allow jump
af_block_chat < value > - Block chat when a player is frozen. 0 : don't block chat ; 1 : block say ; 2 : block say_team ; 3 : block both
* Notes : You have to use the chatcolor plugin of ConnorMcLeod : https://forums.alliedmods.net/showthread.php?p=851160
A player who die is automaticaly unfreezed
A freezed bot can jump even if af_allow_jump is set on "0"
A freezed player is glowed in blue
* Commands : bind < key > "freeze" -> Require admin flag (default : ADMIN_KICK) definable on line X (#define ADMIN_ALLOWED)
-> Freeze/Unfreeze a player
* To approvers : A lot of freeze plugins do same things. This plugins is different because the freeze is by aiming the player, and there is some cvars to config to your tastes
* Credits : ConnorMcLeod - Part of [Un]Freeze stock
* To do : Give me ideas ? :3
* Changelog : v0.0.3 (3 dec 2011) - Add ML
v0.0.2 - Add a glow and some cvars to config to your tastes
v0.0.1 - First release
*/
#include < amxmodx >
#include < engine >
#include < fun >
#include < hamsandwich >
#include < fakemeta >
#include < chatcolor >
#define IsPlayer(%1) (1 <= %1 <= g_iMaxPlayers)
#define is_user_frozen(%1) bFrozen[%1]
#define ADMIN_ALLOWED ADMIN_KICK
/* const */
const iVictim = 2;
const XO_WEAPONS = 4;
const m_pPlayer = 41;
const m_iId = 43;
/* */
new g_iMaxPlayers;
new fwPreThink;
/* bool */
new bool:bFrozen[ 33 ];
/* */
/* pcvars */
new pCvarDistance;
new pCvarAllowMouse;
new pCvarOnlyKnife;
new pCvarAllowJump;
new pCvarBlockChat;
new pCvarBlockVoice;
/* */
/* floats */
new Float: iAngles[ 33 ][ 3 ];
/* */
public plugin_init( )
{
register_plugin( "Aim Freeze" , "0.0.4" , "Devil" );
register_dictionary_colored( "aimfreeze.txt" );
register_clcmd( "freeze" , "cmdFreezePlayer" );
register_clcmd( "say" , "cmdHookSay" );
register_clcmd( "say_team" , "cmdHookSay_Team" );
register_event( "CurWeapon" , "eventCurWeapon" , "be" , "1=1" , "2!29" ); // https://wiki.amxmodx.org/CS_Weapons_Information
register_event( "DeathMsg" , "eventDeathMsg" , "a" );
register_logevent( "eventRoundEnd" , 2 , "1=Round_End" );
pCvarDistance = register_cvar( "af_distance" , "400" ); // distance max between aimer and aimed
pCvarAllowMouse = register_cvar( "af_allow_mouse" , "0" ); // 1 : allow move mouse ; 0 : not allow move mouse
pCvarOnlyKnife = register_cvar( "af_only_knife" , "1" ); // 1 : only allow knife ; 0 : allow all weapons
pCvarAllowJump = register_cvar( "af_allow_jump" , "0" ); // 1 : allow jump ; 0 : not allow jump
pCvarBlockChat = register_cvar( "af_block_chat" , "3" ); // 0 : no blocking ; 1 : block say ; 2 : block say_team ; 3 : block both
pCvarBlockVoice = register_cvar( "af_block_voice" , "1" ); // 0 : no blocking ; 1 : block voice
RegisterHam( Ham_Spawn , "player" , "Player_Spawn" , true );
RegisterHam( Ham_Player_Jump , "player" , "Player_Jump" , false );
g_iMaxPlayers = get_maxplayers( );
}
public cmdFreezePlayer( id )
{
if( !( get_user_flags( id ) & ADMIN_ALLOWED ) )
return PLUGIN_HANDLED;
if( !is_user_alive( id ) )
return PLUGIN_HANDLED;
new tempid , body;
new Float:flDistance = get_user_aiming( id , tempid , body );
if( IsPlayer( tempid ) &&
is_user_alive( tempid ) &&
flDistance <= get_pcvar_float( pCvarDistance ) )
{
new szNameID[ 32 ] , szNameTempID[ 32 ];
get_user_name( id , szNameID , charsmax( szNameID ) );
get_user_name( tempid , szNameTempID , charsmax( szNameTempID ) );
if( is_user_frozen( tempid ) )
{
UnFreeze( tempid );
client_print_color( 0 , DontChange , "%L" , 0 , "UNFREEZE_PLAYER" , szNameID , szNameTempID );
}
else
{
Freeze( tempid );
client_print_color( 0 , DontChange , "%L" , 0 , "FREEZE_PLAYER" , szNameID , szNameTempID );
}
}
return PLUGIN_HANDLED;
}
public cmdHookSay( id )
{
if( is_user_frozen( id ) )
{
new iBlockChat = get_pcvar_num( pCvarBlockChat );
if( iBlockChat == 1 || iBlockChat == 3 )
{
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
public cmdHookSay_Team( id )
{
if( is_user_frozen( id ) )
{
new iBlockChat = get_pcvar_num( pCvarBlockChat );
if( iBlockChat == 2 || iBlockChat == 3 )
{
return PLUGIN_HANDLED;
}
}
return PLUGIN_CONTINUE;
}
public Player_Jump( id )
{
if( is_user_frozen( id ) && !get_pcvar_num( pCvarAllowJump ) )
{
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public Player_Spawn( id )
{
if( is_user_alive( id ) )
{
if( is_user_frozen( id ) )
{
UnFreeze( id );
}
}
}
public fwPlayerPreThink( id )
{
if( is_user_frozen( id ) && !get_pcvar_num( pCvarAllowMouse ) )
{
if( is_user_alive( id ) )
{
set_pev( id , pev_v_angle , iAngles[ id ] );
set_pev( id , pev_fixangle , 1 );
}
}
}
public eventCurWeapon( id )
{
if( is_user_alive( id ) )
{
if( is_user_frozen( id ) && get_pcvar_num( pCvarOnlyKnife ) )
{
engclient_cmd( id , "weapon_knife" );
}
}
}
public eventDeathMsg( )
{
UnFreeze( read_data( iVictim ) );
}
public eventRoundEnd( )
{
new iPlayers[ 32 ] , iNum , i , id;
get_players( iPlayers , iNum , "a" );
for( i = 0; i < iNum; i++ )
{
id = iPlayers[ i ];
if( is_user_frozen( id ) )
{
UnFreeze( id );
}
}
}
Freeze( id )
{
new iFlags = pev( id , pev_flags );
if( ~iFlags & FL_FROZEN )
{
set_pev( id , pev_flags , iFlags | FL_FROZEN );
pev( id , pev_v_angle , iAngles[ id ] );
set_user_rendering( id , kRenderFxGlowShell , 0 , 100 , 200 , kRenderNormal , 16 );
if( get_pcvar_num( pCvarBlockVoice ) )
set_speak( id , SPEAK_MUTED );
if( !fwPreThink && !get_pcvar_num( pCvarAllowMouse ) )
fwPreThink = register_forward( FM_PlayerPreThink , "fwPlayerPreThink" );
}
bFrozen[ id ] = true;
}
UnFreeze( id )
{
new frozenCount = 0;
bFrozen[ id ] = false;
new iFlags = pev( id , pev_flags ) ;
if( iFlags & FL_FROZEN )
{
set_pev( id , pev_flags , iFlags & ~FL_FROZEN ) ;
set_user_rendering( id , kRenderFxNone , 0 , 0 , 0 , kRenderNormal , 0 );
new iPlayers[ 32 ] , iNum , i , tid;
get_players( iPlayers , iNum , "a" );
for( i = 0; i < iNum; i++ )
{
tid = iPlayers[ i ];
if( is_user_frozen( tid ) )
{
frozenCount++;
}
}
if( get_speak( id ) == SPEAK_MUTED )
set_speak( id , SPEAK_NORMAL );
if( !frozenCount && fwPreThink )
unregister_forward( FM_PlayerPreThink , fwPreThink );
}
}
-
Cevap: Freeze-Unfreeze
PHP- Kodu:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#define PLUGIN "Freeze - Unfreeze"
#define VERSION "1.0"
#define AUTHOR "akcaliberkk"
new bool:gFrozen[33];
new pCvarAllowMouse, pCvarOnlyKnife, pCvarAllowJump
new Float: iAngles[ 33 ][ 3 ];
new fwPreThink;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
pCvarAllowMouse = register_cvar( "af_allow_mouse" , "0" ); // 1 : allow move mouse ; 0 : not allow move mouse
pCvarOnlyKnife = register_cvar( "af_only_knife" , "1" ); // 1 : only allow knife ; 0 : allow all weapons
pCvarAllowJump = register_cvar( "af_allow_jump" , "0" )
register_concmd("amx_freeze","cmdFreeze",ADMIN_BAN)
register_concmd("amx_unfreeze","cmdUnFreeze",ADMIN_BAN)
register_event( "CurWeapon" , "eventCurWeapon" , "be" , "1=1" , "2!29" );
register_event( "DeathMsg" , "eventDeathMsg" , "a" );
register_logevent( "eventRoundEnd" , 2 , "1=Round_End" );
RegisterHam( Ham_Spawn , "player" , "Player_Spawn" , true );
RegisterHam( Ham_Player_Jump , "player" , "Player_Jump" , false );
}
public eventCurWeapon(id) {
if( is_user_alive( id ) ){
if( gFrozen[id] && get_pcvar_num( pCvarOnlyKnife ) ){
engclient_cmd( id , "weapon_knife" );
}
}
}
public eventDeathMsg() {
UnFreeze(read_data(2));
}
public eventRoundEnd() {
new iPlayers[ 32 ] , iNum , i , id;
get_players( iPlayers , iNum , "a" );
for( i = 0; i < iNum; i++ ) {
id = iPlayers[ i ];
if( gFrozen[id] ){
UnFreeze( id );
}
}
}
public Player_Jump( id ) {
if( gFrozen[id] && !get_pcvar_num( pCvarAllowJump ) ) {
return HAM_SUPERCEDE;
}
return HAM_IGNORED;
}
public Player_Spawn( id ){
if( is_user_alive( id ) ) {
if( gFrozen[id] ) {
UnFreeze( id );
}
}
}
public fwPlayerPreThink( id ) {
if( gFrozen[id] && !get_pcvar_num( pCvarAllowMouse ) ){
if( is_user_alive( id ) ) {
set_pev( id , pev_v_angle , iAngles[ id ] );
set_pev( id , pev_fixangle , 1 );
}
}
}
public cmdFreeze(id,level,cid) {
if(!cmd_access(id,level,cid,3)) return PLUGIN_HANDLED
new arg1[32],arg2[6];
new targetname[32], adminname[32];
read_argv(1,arg1,31)
read_argv(2,arg2,31)
get_user_name(id,adminname,31);
new sure = str_to_num(arg2);
if(sure < 0) sure = 0;
if(arg1[0] == '@') {
new players[32],inum;
if(equali(arg1[1],"T")) copy(arg1[1],31,"TERRORIST");
if(equali(arg1[1],"ALL")) get_players(players,inum)
else get_players(players,inum,"ae",arg1[1]);
if(!inum) {
console_print(id,"Girilen takimda oyuncu bulunamadi.");
return PLUGIN_HANDLED
}
new tmp;
for(new i;i<inum;i++) {
tmp = players[i];
if(gFrozen[tmp]) continue;
Freeze(tmp)
client_print(tmp,print_center,"DONDURULDUN");
}
new szSure[16];
if(!sure) copy(szSure,15,"");
else format(szSure,15," %d sn boyunca",sure);
if(equali(arg1[1],"all")) client_print(0,print_chat,"[AMXX] ADMIN %s: Tum oyunculari%s dondurdu.",adminname,szSure);
else client_print(0,print_chat,"[AMXX] ADMIN %s: %s takimindaki oyunculari%s dondurdu.",adminname,arg1[1],szSure);
set_task(float(sure),"TaskUnFreeze");
}
else {
new Uid = find_player("bhl",arg1);
if(!Uid) {
console_print(id,"Oyuncu bulunamadi !")
return PLUGIN_HANDLED
}
if(gFrozen[Uid]) {
console_print(id,"Oyuncu zaten donuk !")
return PLUGIN_HANDLED
}
new szSure[16];
if(!sure) copy(szSure,15,"");
else format(szSure,15," %d sn boyunca",sure);
get_user_name(Uid,targetname,31);
client_print(Uid,print_center,"DONDURULDUN");
client_print(0,print_chat,"[AMXX] ADMIN %s: %s adli oyuncuyu%s dondurdu.",adminname,targetname,szSure)
Freeze(Uid)
set_task(float(sure),"TaskUnFreeze",Uid);
}
return PLUGIN_HANDLED
}
public cmdUnFreeze(id,level,cid) {
if(!cmd_access(id,level,cid,2)) return PLUGIN_HANDLED
new arg1[32]
new targetname[32], adminname[32];
read_argv(1,arg1,31)
get_user_name(id,adminname,31);
if(arg1[0] == '@') {
new players[32],inum;
if(equali(arg1[1],"T")) copy(arg1[1],31,"TERRORIST");
if(equali(arg1[1],"ALL")) get_players(players,inum)
else get_players(players,inum,"ae",arg1[1]);
if(!inum) {
console_print(id,"Girilen takimda oyuncu bulunamadi.");
return PLUGIN_HANDLED
}
new tmp;
for(new i;i<inum;i++) {
tmp = players[i];
if(!gFrozen[tmp]) continue;
UnFreeze(tmp);
client_print(tmp,print_center,"COZULDUN"); // :S
}
if(equali(arg1[1],"all")) client_print(0,print_chat,"[AMXX] ADMIN %s: Tum oyunculari cozdu.",adminname);
else client_print(0,print_chat,"[AMXX] ADMIN %s: %s takimindaki oyunculari cozdu.",adminname,arg1[1]);
if(task_exists(0)) remove_task(0);
}
else {
new Uid = find_player("bhl",arg1);
if(!Uid) {
console_print(id,"Oyuncu bulunamadi !")
return PLUGIN_HANDLED
}
if(!gFrozen[Uid]) {
console_print(id,"Oyuncu zaten donuk degil !")
return PLUGIN_HANDLED
}
get_user_name(Uid,targetname,31);
client_print(Uid,print_center,"COZULDUN"); // :S
client_print(0,print_chat,"[AMXX] ADMIN %s: %s adli oyuncuyu cozdu.",adminname,targetname)
UnFreeze(Uid);
if(task_exists(Uid)) remove_task(Uid);
}
return PLUGIN_HANDLED
}
UnFreeze( id ) {
new frozenCount = 0;
gFrozen[ id ] = false;
new iFlags = pev( id , pev_flags ) ;
if( iFlags & FL_FROZEN ) {
set_pev( id , pev_flags , iFlags & ~FL_FROZEN ) ;
set_user_rendering( id , kRenderFxNone , 0 , 0 , 0 , kRenderNormal , 0 );
new iPlayers[ 32 ] , iNum , i , tid;
get_players( iPlayers , iNum , "a" );
for( i = 0; i < iNum; i++ ){
tid = iPlayers[ i ];
if( gFrozen[ tid ] ) {
frozenCount++;
}
}
if( !frozenCount && fwPreThink ) unregister_forward( FM_PlayerPreThink , fwPreThink );
}
}
Freeze(id) {
new iFlags = pev( id , pev_flags );
if( ~iFlags & FL_FROZEN ) {
set_pev( id , pev_flags , iFlags | FL_FROZEN );
pev( id , pev_v_angle , iAngles[ id ] );
set_user_rendering( id , kRenderFxGlowShell , 0 , 100 , 200 , kRenderNormal , 16 );
if( !fwPreThink && !get_pcvar_num( pCvarAllowMouse ) )
fwPreThink = register_forward( FM_PlayerPreThink , "fwPlayerPreThink" );
}
gFrozen[ id ] = true;
}
public TaskUnFreeze(id) {
if(!id) {
new players[32],inum;
get_players(players,inum)
new tmp;
for(new i;i<inum;i++) {
tmp = players[i]
if(gFrozen[tmp]) {
UnFreeze(tmp)
client_print(tmp,print_center,"COZULDUN") // :S
}
}
}
else {
if(gFrozen[id]) {
UnFreeze(id)
client_print(id,print_center,"COZULDUN") // :S
}
}
}
denemeye zamanım yoktu, bir zahmet test işini sen hallet :)
-
Cevap: Freeze-Unfreeze
Konunun çözüldüğünü özelden belirtti.
Çözülmüş İsteklere taşındı.
-
Cevap: Freeze-Unfreeze
SEO by vBSEO 3.6.0 ©2011, Crawlability, Inc.