AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Flash Info (https://forums.alliedmods.net/showthread.php?t=92761)

PaFcIo 05-19-2009 11:43

Flash Info
 
Hey, could someone rewrite this plugin to show info for all players and not for the team and in addition that it was only:

Message to the Flashed player:
"You have been flashed by %s"

Message to flasher (attacker);
"You flashed a %s players"

Sma:
PHP Code:

#include <amxmodx> 
#include <fakemeta> 

#define TEMPENTITY    "23"
#define BLINDED_FULLY    255
#define BLINDED_PARTLY    200 

new const TFSVERSION[] = "1.1"
new Float:FLASH_TIMER 1.52    // Time from throwing a FB to the bang (1.52 seconds?)
new g_flasher 0         // id of the flasher


public plugin_init() { 
    
register_plugin("Team Flash Snitch",TFSVERSION,"Tender")
    
    
register_cvar("tfs_sound","1")
    
register_cvar("tfs_adminchat","1")
    
    
register_event("ScreenFade""event_blinded""be""4=255""5=255""6=255""7>199"
    
register_event(TEMPENTITY"event_flashsmokepuff""a""1=5""6=25""7=6"
    
register_forward(FM_SetModel"forward_setmodel"


public 
plugin_precache() {
    
precache_sound ("radio/bot/im_blind.wav"
    return 
PLUGIN_CONTINUE 
}



public 
event_blinded(const ID) { // someone got flashed
     
    
new alpha read_data(7
    if (
alpha != BLINDED_FULLY && alpha != BLINDED_PARTLY || !is_user_alive(ID)) 
        return 
PLUGIN_CONTINUE 
    
if(get_user_team(ID) == get_user_team(g_flasher) && ID != g_flasher){
        new 
message1[128], message2[128]
        new 
flasher[32], name[32
        
get_user_name(g_flasherflasher31
        
get_user_name(IDname31
        
format(message1127"^x04[Team Flash Snitch]^x01 You´ve been teamflashed by %s"flasher)    
        
format(message2127"^x04[Team Flash Snitch]^x01 You %sflashed a teammate (%s)"alpha == BLINDED_FULLY "totally " ""name)
        
colored_msg(ID,message1)
        
colored_msg(g_flasher,message2)
        if(
get_cvar_num("tfs_sound")>0client_cmd(g_flasher,"spk sound/radio/bot/im_blind.wav")
        if(
alpha == BLINDED_FULLY && get_cvar_num("tfs_adminchat")) server_cmd("amx_chat %s flashed a teammate (%s)",flasher,name)
    }
    return 
PLUGIN_CONTINUE 



public 
colored_msg(id,msg[]) { 
    
message_begin(MSG_ONEget_user_msgid("SayText"), {0,0,0}, id)
    
write_byte(id)
    
write_string(msg)
    
message_end()
}

public 
event_flashsmokepuff() { // a flash has banged

    
set_task(0.05,"reset_flasher"// wait until all is announced
    
return PLUGIN_CONTINUE


public 
reset_flasher(){ 
    
g_flasher 0    // clear g_flasher
}


public 
get_flasher(id){ // a flash is about to bang
    
g_flasher = (id 524627)
}


public 
forward_setmodel(const ENTITYmodel[]) { // a flash is thrown
    
    
if (!equal(model"models/w_flashbang.mdl")) 
        return 
FMRES_IGNORED 

    
new owner pev(ENTITYpev_owner)
    if (
owner == 0
        return 
FMRES_IGNORED 

    set_task
(FLASH_TIMER,"get_flasher"524627+owner)
   
    return 
FMRES_IGNORED 


Thanks

Sorry for my English.

padilha007 05-19-2009 11:55

Re: Flash Info
 
read:

http://forums.alliedmods.net/showthr...ighlight=flash

PaFcIo 05-19-2009 12:16

Re: Flash Info
 
It is in the plugin only shows in the team anymore and do not know how to transform itself to show all players :(


All times are GMT -4. The time now is 01:26.

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