AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [Request] fix blind? (https://forums.alliedmods.net/showthread.php?t=93954)

Trafalete 06-04-2009 17:34

[Request] fix blind?
 
http://forums.alliedmods.net/showthread.php?p=34767

the problem with the plugin i gave you is that it's old, unsupported and buggy

sometimes it works, sometimes it doesn't, and if i blind a player and he leaves the server, when someone else joins the server, he gets blinded

i couldn't find the bug as why it isn't working on some people ( and they are not cheaters ( even casted on me several times and sometimes it didn't make screen black ) ) but i think the problem with blinded person leaving the server and next person to join getting blind is because when the guy leaves the server, id isn't unblinded

fysiks 06-05-2009 00:46

Re: [Request] fix blind?
 
Use this one: http://forums.alliedmods.net/showpos...5&postcount=23

Trafalete 06-06-2009 14:48

Re: [Request] fix blind?
 
my bad....read only the first page and saw that the guy was banned...

thank's alot mate for pointing out the ovious to a blind man

fysiks 06-06-2009 15:28

Re: [Request] fix blind?
 
No problem. I was looking through the posts to see if anyone else was having the same problem and I came upon that post :). If you have a problem with a plugin it's likely that someone has had a similar problem at one time so just read through the posts and you might get an answer :).

ConnorMcLeod 06-06-2009 16:02

Re: [Request] fix blind?
 
I may update it again some day :)
Actual version i have is :

PHP Code:

#include <amxmodx> 
#include <amxmisc> 

#define MAX_PLAYERS    32
#define MAX_AUTHID_LENGTH 22

#define FFADE_IN            0x0000
#define FFADE_OUT            0x0001
#define FFADE_STAYOUT        0x0004

#define set_user_blinded(%1)        g_bBlinded |= 1<<(%1 & 31)
#define set_user_unblinded(%1)    g_bBlinded &= ~( 1<<(%1 & 31) )
#define is_user_blinded(%1)        g_bBlinded & 1<<(%1 & 31)

const CMDTARGET_BLIND    = (CMDTARGET_OBEY_IMMUNITY|CMDTARGET_ALLOW_SELF|CMDTARGET_ONLY_ALIVE|CMDTARGET_NO_BOTS)

new 
g_bBlinded
new gmsgScreenFade

public plugin_init()
{
    
register_plugin("AMX Blind""v1.2""T(+)rget")

    
register_event("ScreenFade""Event_ScreenFade""b")

    
register_concmd("amx_blind""AdminCommand_BlindUser"ADMIN_KICK"<authid, nick or #userid>"
    
register_concmd("amx_unblind""AdminCommand_UnblindUser"ADMIN_KICK"<authid, nick or #userid>")

    
gmsgScreenFade get_user_msgid("ScreenFade")
}

public 
client_putinserverid )
{
    
set_user_unblinded(id)
}

public 
AdminCommand_BlindUser(idlevelcid)

    if(!
cmd_access(idlevelcid2))
    {
        return 
PLUGIN_HANDLED
    
}

    new 
szArg[32
    
read_argv(1szArgcharsmax(szArg)) 
    new 
iPlayer
    
if( !(iPlayer cmd_target(idszArgCMDTARGET_BLIND)) )
    {
        return 
PLUGIN_HANDLED
    
}

    new 
szName2[32]
    
get_user_name(iPlayerszName2charsmax(szName2))

    if( 
is_user_blinded(iPlayer) )
    {
        
console_print(id"Client ^"%s^" is already blind"szName2)
        return 
PLUGIN_HANDLED
    
}
    else
    {
        
set_user_blinded(iPlayer)
        static const 
iBlindFxTime = (1<<3)|(1<<8)|(1<<10)
        
Send_ScreenFade(idiBlindFxTimeiBlindFxTimeFFADE_OUT|FFADE_STAYOUT0xFF)
    }

    new 
szName[32]
    
get_user_name(idszNamecharsmax(szName))
    
show_activity_key("ADMIN: blinded %s""ADMIN %s: blinded %s"szNameszName2)

    
console_print(id"Client ^"%s^" blinded"szName2

    return 
PLUGIN_HANDLED 
}

public 
AdminCommand_UnblindUser(idlevelcid)

    if(!
cmd_access(idlevelcid2))
    {
        return 
PLUGIN_HANDLED
    
}

    new 
szArg[32
    
read_argv(1szArgcharsmax(szArg)) 
    new 
iPlayer
    
if( !(iPlayer cmd_target(idszArgCMDTARGET_BLIND)) )
    {
        return 
PLUGIN_HANDLED
    
}

    new 
szName2[32]
    
get_user_name(iPlayerszName2charsmax(szName2))
 
    if( 
is_user_blinded(iPlayer) )
    {
        
set_user_unblinded(iPlayer)
        
Send_ScreenFade(iPlayer40FFADE_IN0)
    }
    else
    {
        
console_print(id"Client ^"%s^" is already unblind"szName2)
        return 
PLUGIN_HANDLED
    
}

    new 
szName[32]
    
get_user_name(idszNamecharsmax(szName))
    
show_activity_key("ADMIN: unblinded %s""ADMIN %s: unblinded %s"szNameszName2)

    
console_print(id"Client ^"%s^" unblinded"szName2

    return 
PLUGIN_HANDLED
}

public 
Event_ScreenFadeid 
{
    if( 
is_user_blinded(id) )
    {
        
Send_ScreenFade(id40FFADE_OUT|FFADE_STAYOUT0xFF)
    }
}

Send_ScreenFade(idiFadeTimeiHoldTimeiFlagsiAlpha)
{
    
message_begin(MSG_ONE_UNRELIABLEgmsgScreenFade_id)
    
write_short(iFadeTime)
    
write_short(iHoldTime)
    
write_short(iFlags)
    
write_byte(0)
    
write_byte(0)
    
write_byte(0)
    
write_byte(iAlpha)
    
message_end()




All times are GMT -4. The time now is 23:53.

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