AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   FRC v12.0 [Team Flash, Detector, Tool] (https://forums.alliedmods.net/showthread.php?t=74091)

ot_207 07-12-2008 02:54

FRC v12.0 [Team Flash, Detector, Tool]
 
5 Attachment(s)
Flashbang Remote Control v12.0

Includes:
<amxmodx>
<cstrike>
<fakemeta>


Description:
This plugin offers control over the flashbang kaboom behavior (especially when team flashed). This plugin is an all in one plugin from all the ones that have been made in amxx.

Features:
1. Multilanguage support. For translations please click here.
2. Announce (Idea from "Team Flash Snitch"). This plugin announces the moment you have been flashed by a teammate, and the moment you team flashed.
Ex: [Team Flash Control] You flashed a teammate (John)
[Team Flash Control] You have been flashed by John
The name John will appear in team color.
3. Admin announce (Idea from "Team Flash Snitch"). This plugin announces the admins when a player has teamflashed, and the moment the teamflasher is punished.
4. Sound (Idea from "Team Flash Snitch"). The teamflasher hears in his radio "I'm blind!!!" when he flashes just one team mate. If he flashes more than 1 the sound will overlap.
5. Block self flash. It will block the moment when you flash yourself.
6. Block team flash. It will block the moment when you flash your team members.
7. Punish sistem. It includes a sistem that punishes the teamflasher (if set) The player that has been punished isn't allowed to throw flashbangs anymore, even if he has some.
8. Bug fixer (Thanks to MPNumB). It fixes the exploit. There are moments when people throw flash grenades in certain areas of a map and it totally blinds you, even when you are no where near it.
9. Precision. It shows with precision the person who flashed you.
10. Dinamic flash timing support. This means that if another plugin makes the flash explode sooner or later this plugin will detect it! So no more team flash escapes :P.
11. Special flash block (the new feature as requested by Maurice). The plugin blocks the flash for all players if a teammate is flashed.
12. Dynamic flash light -> add a touch of realism to the moment a player is flashed
13. Color flash -> color of the flash screen effect ( the color and the dynamic flash light are sincronized so the color flash cvars are affecting the dynamic light)
14. Control Pannel -> you can customize all the settings of the plugin exept the colors of the flash
14. API interface, gives you control over almost every plugin feature/function!

Sub Plugins/Extentions:
Reality/Bug fixes
FRC FOV Bugfix
FRC Glass Flashbang
FRC Water Flashbang
Punishments
FRC Can't Buy
FRC Money Punish
Others
FRC Admin LOG
FRC Team Colors

Request an extension!

Commands:
amx_flash_control_menu (ADMIN_CFG flag) Shows settings menu for flashbang remote control
amx_fcm (ADMIN_CFG flag) Shows settings menu for flashbang remote control

Cvars:
frc_enable 1 // enable the plugin, the API forwards will work!!!
frc_sound 1 // the sound that is sent to the flasher
frc_adminchat 1 // the admin message
frc_block_team_flash 0 // block the moment when you flash your teammates
frc_block_self_flash 0 // block the moment when you flash yourself
frc_block_special_flash 0 // special flash block the explanation is under the cvars
frc_flasher_punish 1 // punish the player that flashed too much
frc_flasher_counter 1 // set to 0 count only the full teamflashes, 1 count all the teamflashes
frc_flasher_mistake_allow 10 // the times that a player is allowed to flash his teammates before being punished
frc_flasher_warn 0 // warn the player
frc_flasher_punish_mode 2 // punish mode: 0 -> until map end, 1 -> number of rounds 2 -> by time
frc_flasher_punish_type 0 // punish type: 0 -> block throw, 1 -> kill when he teamflashes, 2 -> flash himself when he teamflashes
frc_flasher_punish_control (default 2) - punish mode control controls how many rounds/minutes the player will have problems (doesn't work with punish mode 0)
frc_bug_fix 1 // bug fix control toggle
frc_color_mode 2 // 0 - off, 1 - specified color, 2 - random color chose(for all players), 3 - random color for every player
frc_red_color 100 // the red color cvar
frc_green_color 100 // the green color cvar
frc_blue_color 255 // the blue color cvar
frc_dynamic_light 1 // dynamic light

Note! All cvars exept "frc_flasher_mistake_allow" and "frc_color_mode" work on this system: When = 0 they disable the feature that coresponds to them, if not = 0 then the feature works!
Note! tfc_ppl_mistake_allow must be pozitive (>0) becouse if tfc_punish in this case is not equal with 0 the plugin will punish everyone.

Punish system information:
The punish system detects counts how many teammates you have flashed.
If you reach the limit that is held in the cvar frc_flasher_mistake_allow
you will be punished.
The punish can be set how long it takes through the frc_flasher_punish_mode cvar
0 -> until map end
1 -> a number of rounds
2 -> x minutes
The number of rounds/minutes can be set through this cvar frc_flasher_punish_control. It won't work if the frc_flasher_punish_mode is set to 0.
The punish has 3 effects that can be set through the frc_flasher_punish_type cvar
0 -> blocks the ability to throw grenades
1 -> when you teamflash you will be killed
2 -> when you teamflash you will be flashed

Usefull links:
Servers using this plugin
Translation thread
FRC.inc file description. Read this if you are interested in the API functions of the plugin!

Changelog:
PHP Code:

12.0 remade some forwardsmade the plugin more efficientadded cvar for chat messagesmade the dynamic light hookable
11.0  added more forwards and natives for the pluginsome isues fixed!
10.0  api interface, the plugin can be controled by other plugins, or can offer extra inforemade some small parts for better efficiency.
*  
9.5  - new method of remembering the ownerLow on memory usage and no need to modify plugin code for more entities!
*  
9.1  last improvements the plugin can now be seen on servers + new cvar for punish system.
*  
9.0  control pannel last improvements
*  8.5  - new punish system
*  8.1  cvar bug fixflashlight bug fix
*  8.0  - new feature -> color flashbangs, + new name Flashbang Remote Control
*  7.0  updated all the featuresnow work 100% + new dynamic light feature
*  6.5  improvement to the player originnow the plugin gets the players head
*  6    major improvement to all the blocks (including the new feature)
*  
5.5  small improvement to the moment a player is flashed (when a player is flashed for a long time the flash will count)
*  
5.3  big improvement to the bug detection
*  5    improvement to the new feature
*  5.0b - new feature added -> block flash when you flashed a teammate and a enemy together
*  4.5  bugfix feature added 
*  4    multilang
*  3.5  added more featuresthe plugin has a new name "Team Flash Control"
*  3    optimized plugin (pcvars + new forwards) -> now works 100% (2008-07-11)
*  
2    optimized plugin -> now works 70% (2008-07-08)
*  
1.1  fixed bugmore than one player can get a message from the same teamflash event
*         new cvartfc_adminchat (2007-11-04)
*  
1.0  sound on/off cvartfc_sound 1/(2006-04-14)
*  
0.3  fixed bugdead spectators will nog get message about teamflash (2006-03-16)
*  
0.2  changed flash owner codea timer is added"[Team Flash Snitch]" in green text (2006-03-12)
*  
0.1  initial release (2006-01-25

Credits:
Tender for "Team Flash Snitch"
MPNumB for "Anti Flashbang Bug"
v3x for Colored Flashbangs
XxAvalanchexX for Flashbang Dynamic Light
Translators
Testers

anakin_cstrike 07-12-2008 03:00

Re: Team Flash Control
 
Niice:up:

ot_207 07-12-2008 03:17

Re: Team Flash Control
 
Quote:

Originally Posted by anakin_cstrike (Post 651449)
Niice:up:

If you are testing it ... waiting for a good report! :up:
Please try to test all the features!

bmann_420 07-12-2008 16:31

Re: Team Flash Control
 
Interesting, I would call the .zip file cstrike and just add the txt file in the proper file, same with the sound folder. If you want to upload a .amxx, you need to as an admin for approval, and will do it for you.

Good job tho, and your asking if it works? I thought plugin creators were supposed to test their work? lol

ot_207 07-13-2008 01:16

Re: Team Flash Control
 
Quote:

Originally Posted by bmann_420 (Post 651759)
Good job tho, and your asking if it works? I thought plugin creators were supposed to test their work? lol

Thanks! I've tested the plugin and the precision is good. The other day I didn't had time for it ...

[EDIT] The thing that you said with the cstrike zip archive is a thing that I will do after the translation text file has at least 10 languages. [/EDIT]

v3x 07-13-2008 01:38

Re: Team Flash Control
 
Nice job.

Waiting for more good feedback before I approve :)

IneedHelp 07-13-2008 20:18

Re: Team Flash Control
 
I Like the plugin, I Test it and seems good, I can't test all the features but more later i'm going to do it, be patient :P

And..this:
Quote:

8. Bug fixer (Thanks to MPNumB). It fixes the exploit. There are moments when people throw flash grenades in certain areas of a map and it totally blinds you, even when you are no where near it.
ALL the places that i know are fixed? I test in Dust2 and worked fine..I think.

ot_207 07-14-2008 00:44

Re: Team Flash Control
 
Quote:

Originally Posted by IneedHelp (Post 652379)
ALL the places that i know are fixed? I test in Dust2 and worked fine..I think.

Yes, normally they should be fixed ... and not only on de_dust2, on all maps that have this kind of problems

Here is a video that shows the places where a player can use the flash exploit in de_dust2. You can test them ;).
Flash Exploit Video
The video shows more bugs and even tricks ...
But the flash bugs are also ;)

And waiting for a good report :up:!

Maurice 07-15-2008 04:25

Re: Team Flash Control
 
If i'm understanding it correct the option tfc_block_team_flash (default 0) - block the moment when you flash your teammates will make this request possible, when a teammate is full flashed the hole flashbang effect is removed from the game so noone get flashed?

ot_207 07-15-2008 12:08

Re: Team Flash Control
 
Quote:

Originally Posted by Maurice (Post 653026)
If i'm understanding it correct the option tfc_block_team_flash (default 0) - block the moment when you flash your teammates will make this request possible, when a teammate is full flashed the hole flashbang effect is removed from the game so noone get flashed?

Nope ... that's not it. It only removes the team flash ( when you flash your team mate )

If you want I can add this feature to the plugin but I don't know how much precision it will have ...

Maurice 07-15-2008 13:02

Re: Team Flash Control
 
If you could add the function it would be awesome because no one ever managed to do this or wanted to make it. If it don't won't work on all teamflashes it is not that big problem because every removed flash (for the victim) is great to have.

ot_207 07-15-2008 14:32

Re: Team Flash Control
 
Quote:

Originally Posted by Maurice (Post 653159)
If you could add the function it would be awesome because no one ever managed to do this or wanted to make it. If it don't won't work on all teamflashes it is not that big problem because every removed flash (for the victim) is great to have.

Ok... I'll try it.
If it will have precition and it will work I will add this to version 5.

kim_perm 07-23-2008 04:07

Re: Team Flash Control
 
Hehe. I write same plugin, some time ago... :) And his work name is "Flash Control" lol. Funny coincidence.
May check it work at 195.222.130.83:27017, 195.222.130.83:27018
say /flash, to view stats :)

ot_207 07-29-2008 08:43

Re: Team Flash Control
 
Quote:

Originally Posted by v3x (Post 651955)
Nice job.

Waiting for more good feedback before I approve :)

You heard the man! Waiting for reports. :up:

Note -> back from the trip, will update the plugin soon!!!

Dr. Jan Itor 07-29-2008 13:09

Re: Team Flash Control
 
u do not need to post the .amxx file..

ot_207 07-29-2008 15:23

Re: Team Flash Control
 
Quote:

Originally Posted by Dr. Jan Itor (Post 661033)
u do not need to post the .amxx file..

I know that I don't need to post it. I've put it in case the online compiler is broken, if it is necessary I will remove it.

Dr. Jan Itor 07-29-2008 15:49

Re: Team Flash Control
 
lmao i just tested to compare size the online compiler compiled it to 2.43MB

ot_207 07-29-2008 15:57

Re: Team Flash Control
 
Quote:

Originally Posted by Dr. Jan Itor (Post 661136)
lmao i just tested to compare size the online compiler compiled it to 2.43MB

Lol ... this is a thing I didn't notice :mrgreen:.
It is a big difference, I will remove it, after the new update of the plugin.

NEW VERSION 8 + NEW NAME!!!

Maurice 07-31-2008 18:26

Re: Flashbang Remote Control
 
Thanks for adding the requested feature ot_207!

This is for sure the most advanced 'teamflash control' plugin or better said the all in one because some only punish teamflashers and others remove the teamflash but this one got it all and even go further, keep up the good work!

I've 2 questions.

1. This plugin does detect half and full flashed teammates, is it also possible that the plugin only take action by full blinded teamflashes because at some places a teamflash is very fast done but the teammates don't have trouble with it because they are only half or less flashed.

2. When tfc_block_special_flash is enabled this means when a teammate is flashed the flash is complete removed from the game? (eg. teammate's, enemies and the thrower).

This would for me be the best setup because then no one have an advantage someone else is flahed by the same flashbang. The punishment for the thrower is just that the flashbang didn't work and everyone is happy.

ot_207 08-01-2008 01:57

Re: Flashbang Remote Control
 
Quote:

Originally Posted by Maurice (Post 662532)
1. This plugin does detect half and full flashed teammates, is it also possible that the plugin only take action by full blinded teamflashes because at some places a teamflash is very fast done but the teammates don't have trouble with it because they are only half or less flashed.

2. When tfc_block_special_flash is enabled this means when a teammate is flashed the flash is complete removed from the game? (eg. teammate's, enemies and the thrower).

1. It will be possible, but it will take some time becouse the plugin disables the flash before a player is flashed, so it is impossible to know wether he was fully flashed or not. I will look into it ;).

2. When a teammate is flashed (doesn't matter if fully or partialy than the flashbang doesn't have any effect on any player.

Maurice 08-03-2008 18:58

Re: Flashbang Remote Control
 
Quote:

Originally Posted by ot_207 (Post 662640)
1. It will be possible, but it will take some time becouse the plugin disables the flash before a player is flashed, so it is impossible to know wether he was fully flashed or not. I will look into it ;).

Oki, it would be great if it could be added but without it is alse a fantastic plugin, the best one released so far. I've removed all anti TF and TF punish plugins form my servers because this one take care of it all however i noticed the dynamic light also happens when the flashlight is turned on.

ot_207 09-15-2008 04:03

Re: Flashbang Remote Control v9.0
 
New version v9.0

Need new translations!!!

New Features:
14. Control Pannel -> you can customize all the settings of the plugin exept the colors of the flash

New Commands:
amx_flash_control_menu (ADMIN_CFG flag) Shows settings menu for flashbang remote control
amx_fcm (ADMIN_CFG flag) Shows settings menu for flashbang remote control

Changelog:
PHP Code:

*  9.0  control pannel last improvements
*  8.5  - new punish system
*  8.1  cvar bug fixflashlight bug fix 


andyD 01-18-2009 11:09

Re: Flashbang Remote Control v9.1
 
I ve tested it and found some bugs,

When i put in the option "block throw" and allowed team flashes 0 i can not throw a flash , even when it s gonna fall behind a wall.

When i put in option block throw and allowed flashes 0 i can not flash myself .

When i put in the option block throw and allowed flashes 1 i can flash myself for as many times as i want.

In the above examples all the other cvars where set to no or o exept the ones below flash punish.

Seems there are still some bugs there.

i guess the reason for not being able to throww the flash when set to o is because it punishes everyone , the only curious thing there is that i was alone on the server.

andyD 01-19-2009 13:10

Re: Flashbang Remote Control v9.1
 
Seems i was a bit to fast with my complaints, never mind

to excuse myself and because my teammates dont understand english i made a french version of the menu and translated the cvar explaination,
this might come in handy for others so here it is,

Code:

/*
*  Team Flash Control
*
*  Author: OT

*  Changelog:
*
*  9.1  - last improvements + the plugin can now be seen on servers.
*  9.0  - control pannel + last improvements
*  8.5  - new punish system
*  8.1  - cvar bug fix, flashlight bug fix
*  8.0  - new feature -> color flashbangs
*  7.0  - updated all the features, now work 100% + new dynamic light feature
*  6.5  - improvement to the player origin, now the plugin gets the players head
*  6    - major improvement to all the blocks (including the new feature)
*  5.5  - small improvement to the moment a player is flashed (when a player is flashed for a long time the flash will count)
*  5.3  - big improvement to the bug detection
*  5    - improvement to the new feature
*  5.0b - new feature added -> block flash when you flashed a teammate and a enemy together
*  4.5  - bugfix feature added
*  4    - multilang
*  3.5  - added more features, the plugin has a new name "Team Flash Control"
*  3    - optimized plugin (pcvars + new forwards) -> now works 100% (2008-07-11)
*  2    - optimized plugin -> now works > 70% (2008-07-08)
*  1.1  - fixed bug: more than one player can get a message from the same teamflash event
*        new cvar: tfc_adminchat (2007-11-04)
*  1.0  - sound on/off cvar: tfc_sound 1/0 (2006-04-14)
*  0.3  - fixed bug: dead spectators will nog get message about teamflash (2006-03-16)
*  0.2  - changed flash owner code, a timer is added, "[Team Flash Snitch]" in green text (2006-03-12)
*  0.1  - initial release (2006-01-25)
*
*  Credits:
*
*  Tender for Team Flash Snitch
*  MpNumb for Bugfix feature
*  xxAvalanchexx for Dynamiclight
*  v3x for Colored Flashbangs
*/

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

// The defines that hold info on how the user has been blinded
#define BLINDED_FULLY    255
#define BLINDED_PARTLY    200

// Maximum entities
#define MAX_ENT        1126

// Task unique id
#define REMAIN_TASK        642354

// The bones of a player
#define BONE_HEAD        8

// Private data

#if cellbits == 32
#define OFFSET_TEAM        114
#else
#define OFFSET_TEAM        139
#endif

#define OFFSET_LINUX    5

// Message events
new saytext
new scrfade

// Entity owner remember
new g_ent_owner[MAX_ENT] = {0,...}

// Flasher id
new g_flasher = 0

// Flash entity index
new g_flash_ent = 0

// Player info
new g_flash_mon[33] = {0,...}
new bool:g_block_flash[33] = {false, ...}
new g_team_pl[33]
new bool:g_counter_in_effect[33] = {true, ...}
new bool:g_reset_counter[33] = {false, ...}
new g_round_lock[33]
new Float:g_time_lock[33]

// Forward info
new bool:g_allow_forward = true

// Colors
new g_color_red
new g_color_green
new g_color_blue

// Pcvars
enum OptionType
{
    OPTION_TOGGLE = 1,
    OPTION_CELL,
    OPTION_FLOAT
}

enum Option
{
    pc_frc_sound,
    pc_frc_admin,
    pc_frc_block,
    pc_frc_selfb,
    pc_frc_blocka,

    pc_frc_count,
    pc_frc_punish,
    pc_frc_limit,
    pc_frc_warn,
    pc_frc_mode,
    pc_frc_type,
    pc_frc_nr_ctr,

    pc_frc_mcolor,
    pc_frc_rcolor,
    pc_frc_gcolor,
    pc_frc_bcolor,

    pc_frc_dlight,

    pc_frc_bug,
}

new pcvars[Option]
new OptionType:option_type[Option]
new option_value[Option][100]
new option_information[Option][300]

new settingsmenu
new callbacks[2]

new const CFG_FILE_NAME[] = "flash_remote_control.cfg"
new CFG_FILE[300]

public plugin_init()
{
    // Let's register the plugin
    register_plugin("Flash Remote Control","9.1","OT")
    register_cvar("flash_remote_version","9.1",FCVAR_SERVER)
   
    // The basic cvars
    register_option(pc_frc_sound,"frc_sound","0") // son envoyer au flasheur
    register_option(pc_frc_admin,"frc_adminchat","1") // les messages admins
    register_option(pc_frc_block,"frc_block_team_flash","0") // blocker la possibiliter de flash team
    register_option(pc_frc_selfb,"frc_block_self_flash","1") // blocker la possibiliter de se flasher soi meme
    register_option(pc_frc_blocka,"frc_block_team_all_flash","0") // enlever d etre flasher pour tout le monde quand qqn flash team
   
    // The punish system cvars
    register_option(pc_frc_punish,"frc_flasher_punish","1") // punir le joueur qui flash team de trop
    register_option(pc_frc_count,"frc_flasher_counter","0") // 0 -> compter uniquement les flash complet 1 -> compter tout les flash
    register_option(pc_frc_limit,"frc_flasher_mistake_allow","0",OPTION_CELL) // nombre de flash team avant d etre puni
    register_option(pc_frc_warn,"frc_flasher_warn","0") // warn the player
    register_option(pc_frc_mode,"frc_flasher_punish_mode","1",OPTION_CELL) // mode de punition: 0 -> fin de map, 1 -> rounds, 2 -> temps
    register_option(pc_frc_type,"frc_flasher_punish_type","0",OPTION_CELL) // type de punition: 0 -> blocker de pouvoir jeter, 1 -> kill, 2 -> flasher le team flasheur
    register_option(pc_frc_nr_ctr,"frc_flasher_punish_control","0",OPTION_FLOAT) // mode de punition controlle combien de round/minutes le joueur sera puni (ne fonctionne pas avec mode de punition 0)
   
    // Flash color cvars
    register_option(pc_frc_mcolor,"frc_color_mode","0",OPTION_CELL) // 0 -> off, 1 -> couleur specifier, 2 -> couleur variable(meme pour tout les joueurs), 3 -> couleur variable par joueur
    register_option(pc_frc_rcolor,"frc_red_color","100") // couleur rouge cvar
    register_option(pc_frc_gcolor,"frc_green_color","100") // couleur vert cvar
    register_option(pc_frc_bcolor,"frc_blue_color","255") // couleur bleu cvar
   
    // Flash lumiere dynamic cvars, la lumiere dynamique depend des cvars des couleurs flash
    register_option(pc_frc_dlight,"frc_dynamic_light","1") // lumiere dynamic
   
    // Bug fix cvar
    register_option(pc_frc_bug,"frc_bug_fix","1") // activer ou desactiver bug lash
   
    // Special option values
    register_option_value(pc_frc_limit,"0;1;2;3;4")
    register_option_value(pc_frc_mode,"0;1;2")
    register_option_value(pc_frc_type,"0;1;2")
    register_option_value(pc_frc_mcolor,"0;1;2;3")
   
    // Control panel menu
    register_clcmd("amx_flash_control_menu", "conjure_menu", ADMIN_CFG, "Shows settings menu for flashbang remote control.")
    register_clcmd("amx_fcm", "conjure_menu", ADMIN_CFG, "Shows settings menu for flashbang remote control.")
   
    // The events
    register_event("ScreenFade", "event_blinded", "be", "1>4096", "4=255", "5=255", "6=255", "7>199")
    register_event("ScreenFade", "event_override", "be", "4=255", "5=255", "6=255", "7>199")
    register_logevent("event_round_end", 2, "1=Round_End")
   
    // The message constants
    saytext = get_user_msgid("SayText")
    scrfade = get_user_msgid("ScreenFade")
   
    // The fakemeta forwards
    register_forward(FM_SetModel, "fw_setmodel",1)
    register_forward(FM_EmitSound,"fw_emitsound")
    register_forward(FM_Think, "fw_think")
    register_forward(FM_PlayerPreThink,"fw_player_prethink")
    register_forward(FM_FindEntityInSphere,"fw_findentityinsphere")
   
    // Control pannel
    callbacks[0] = menu_makecallback("callback_disabled")
    callbacks[1] = menu_makecallback("callback_enabled")
   
    // The dictionary
    register_dictionary("flashbang_remote_control.txt")
   
    // Config file
    new config[200]
    get_configsdir(config,199)
    format(CFG_FILE,299,"%s/%s",config,CFG_FILE_NAME)
   
    exec_cfg()
}

// Control Pannel

// Cfg save system
public exec_cfg()
{
    if(file_exists(CFG_FILE))
        server_cmd("exec %s",CFG_FILE)
}

public save_cfg()
{
    new file[2000]
    format(file,1999,"echo [Flashbang Remote Control] Executing config file ...^n")
   
    add_to_file(file,1999,pc_frc_sound)
    add_to_file(file,1999,pc_frc_admin)
    add_to_file(file,1999,pc_frc_selfb)
    add_to_file(file,1999,pc_frc_block)
    add_to_file(file,1999,pc_frc_blocka)
    add_to_file(file,1999,pc_frc_punish)
    add_to_file(file,1999,pc_frc_count)
    add_to_file(file,1999,pc_frc_limit)
    add_to_file(file,1999,pc_frc_warn)
    add_to_file(file,1999,pc_frc_mode)
    add_to_file(file,1999,pc_frc_type)
    add_to_file(file,1999,pc_frc_nr_ctr)
    add_to_file(file,1999,pc_frc_mcolor)
    add_to_file(file,1999,pc_frc_rcolor)
    add_to_file(file,1999,pc_frc_gcolor)
    add_to_file(file,1999,pc_frc_bcolor)
    add_to_file(file,1999,pc_frc_dlight)
    add_to_file(file,1999,pc_frc_bug)
   
    format(file,1999,"%secho [Flashbang Remote Control] Settings loaded from config file",file)
   
    delete_file(CFG_FILE)
    write_file(CFG_FILE,file)
}

stock add_to_file(file[], size_of_file, Option:option)
{
    switch (option_type[option])
    {
        case OPTION_TOGGLE,OPTION_CELL: format(file,size_of_file,"%s%s %d^n",file,option_information[option],get_option(option))
        case OPTION_FLOAT: format(file,size_of_file,"%s%s %f^n",file,option_information[option],get_option_float(option))
    }
}

// Control Pannel Menu system
public conjure_menu(id, level, cid)
{
    if (cmd_access(id, level, cid, 1))
    {
        menu_adjust(id)
    }
    return PLUGIN_HANDLED
}

// Let's create the menu!
stock menu_adjust(id, page = 0)
{
    settingsmenu = menu_create("Flash Remote Control Pannel", "menu_handler")
   
    add_option_toggle(pc_frc_admin,"Envoyer message text admin","Oui","Non")
    add_option_toggle(pc_frc_sound,"Jouer le son ^"I'm blind^" ","On","Off")
    add_option_toggle(pc_frc_block,"Blocker flash team","Oui","Non")
    add_option_toggle(pc_frc_selfb,"Blocker de se flasher soi meme","Oui","Non")
    add_option_toggle(pc_frc_blocka,"Blocker flash pour tous quand team flash","Oui","Non")
    add_option_toggle(pc_frc_bug,"Blocker le bug flash","Oui","Non")
    add_option_toggle(pc_frc_dlight,"Lumiere dynamique","Oui","Non")
    add_option_quatrotoggle(pc_frc_mcolor,"couleur de flash","Normal","Couleurs specifier","Couleur par hasard (la meme pour tout les joueurs)","Couleur par hasard par joueur")
   
    add_option_toggle(pc_frc_punish,"Systeme de punition","On","Off")
   
    if (get_option(pc_frc_punish))
    {
        add_option_toggle(pc_frc_warn,"Prevenir celui qui flash","Oui","Non")
        add_option_tritoggle(pc_frc_mode,"Mode de punition","Jusqua fin de map","Par round","Par temps")
        add_option_tritoggle(pc_frc_type,"Type de punition","Impossible de jeter", "Kill", "Auto flash")
        add_cell_option(pc_frc_limit,"Nombre de flash team","Flash team")
       
       
        switch (get_option(pc_frc_mode))
        {
            case 1:
            {
                register_option_value(pc_frc_nr_ctr,"1;2;3;4;5;6;7;8;9;10")
                add_float_cell_option(pc_frc_nr_ctr,"Nombre de round punition","round")
            }
            case 2:
            {   
                register_option_value(pc_frc_nr_ctr,"1;1.5;2;2.5;3;3.5;4;4.5;5;5.5;6;7;8;9;10")
                add_float_option(pc_frc_nr_ctr,"Temps de punition","minutes")
            }
        }
       
    }
   
    menu_display(id, settingsmenu, page)
    return PLUGIN_CONTINUE
}

stock add_option_toggle(Option:control_option, const basetext[], const yestext[], const notext[], Option:displayif = Option:-1)
{
    new cmd[3], itemtext[100]
    num_to_str(_:control_option, cmd, 2)
    format(itemtext, 99, "%s: %s%s", basetext, (get_option(control_option) ? "\y" : "\r" ), (get_option(control_option) ? yestext : notext))
    menu_additem(settingsmenu, itemtext, cmd, _, (displayif != Option:-1 && !get_option(displayif)) ? callbacks[0] : callbacks[1])
}

stock add_option_tritoggle(Option:control_option, const basetext[], const text[], const text2[], const text3[], Option:displayif = Option:-1)
{
    new cmd[3], itemtext[100]
    num_to_str(_:control_option, cmd, 2)
    format(itemtext, 99, "%s:\y %s%s%s", basetext, (get_option(control_option) == 0 ? text : "" ), (get_option(control_option) == 1 ? text2 : "" ), (get_option(control_option) == 2 ? text3 : "" ))
    menu_additem(settingsmenu, itemtext, cmd, _, (displayif != Option:-1 && !get_option(displayif)) ? callbacks[0] : callbacks[1])
}

stock add_option_quatrotoggle(Option:control_option, const basetext[], const text[], const text2[], const text3[], const text4[], Option:displayif = Option:-1)
{
    new cmd[3], itemtext[100]
    num_to_str(_:control_option, cmd, 2)
    format(itemtext, 99, "%s:\y %s%s%s%s", basetext, (get_option(control_option) == 0 ? text : "" ), (get_option(control_option) == 1 ? text2 : "" ), (get_option(control_option) == 2 ? text3 : "" ), (get_option(control_option) == 3 ? text4 : "" ))
    menu_additem(settingsmenu, itemtext, cmd, _, (displayif != Option:-1 && !get_option(displayif)) ? callbacks[0] : callbacks[1])
}

stock add_float_option(Option:control_option, const basetext[], const unit[])
{
    new cmd[3], itemtext[100]
    new value[20]
   
    format(value,19,"%0.2f",get_option_float(control_option))
   
    num_to_str(_:control_option, cmd, 2)
    format(itemtext, 99, "%s: \y%s \r%s", basetext, value, unit)
    menu_additem(settingsmenu, itemtext, cmd, _, _)
}

stock add_float_cell_option(Option:control_option, const basetext[], const unit[])
{
    new cmd[3], itemtext[100]
    new value[20]
   
    format(value,19,"%d",floatround(get_option_float(control_option)))
   
    num_to_str(_:control_option, cmd, 2)
    format(itemtext, 99, "%s: \y%s \r%s", basetext, value, unit)
    menu_additem(settingsmenu, itemtext, cmd, _, _)
}

stock add_cell_option(Option:control_option, const basetext[], const unit[])
{
    new cmd[3], itemtext[100]
    new value[20]
   
    format(value,19,"%d",get_option(control_option))
   
    num_to_str(_:control_option, cmd, 2)
    format(itemtext, 99, "%s: \y%s \r%s", basetext, value, unit)
    menu_additem(settingsmenu, itemtext, cmd, _, _)
}

public callback_disabled(id, menu, item)
{
    return ITEM_DISABLED
}

public callback_enabled(id, menu, item)
{
    return ITEM_ENABLED
}


// Base cvar change system
public menu_handler(id, menu, item)
{
    new access, info[5], callback
    menu_item_getinfo(menu, item, access, info, 4, _, _, callback)
   
    if (item < 0)
    {
        save_cfg()
        return PLUGIN_HANDLED
    }
   
    new cvar = str_to_num(info)
   
    switch (option_type[Option:cvar])
    {
        case OPTION_TOGGLE:
        {
            toggle_option(Option:cvar)
        }
        case OPTION_CELL:
        {
            new value_string[100]
            format(value_string,99,"%s;",option_value[Option:cvar])
           
            new values[20][10]
            new true_value[20]
           
            new last = 0,newpos = 0, k = 0;
           
            for (new i=0;i<100;i++)
            {
                if(equal(value_string[i],";",1))
                {
                    newpos = i
                }
               
                if (newpos > last)
                {                   
                    for (new j=last;j<newpos;j++)
                    {
                        format(values[k],9,"%s%s",values[k],value_string[j])
                    }
                   
                    last = newpos + 1
                    k++
                }
            }
           
            new bool:ok = false
            new counter = 0
           
            for (new i=0;i<k;i++)
            {
                counter++
               
                true_value[i] = str_to_num(values[i])
               
                if (ok == true)
                {
                    set_pcvar_num(pcvars[Option:cvar],true_value[i])
                    counter = 0
                    break
                }
               
                if (true_value[i] == get_option(Option:cvar))
                    ok = true
            }
           
            if (counter == k)
                set_pcvar_num(pcvars[Option:cvar],true_value[0])
        }
        case OPTION_FLOAT:
        {
            new value_string_float[100]
            format(value_string_float,99,"%s;",option_value[Option:cvar])
           
            new values_float[20][10]
            new Float:true_value_float[20]
           
            new last = 0,newpos = 0, k = 0;
           
            for (new i=0;i<100;i++)
            {
                if(equal(value_string_float[i],";",1))
                {
                    newpos = i
                }
               
                if (newpos > last)
                {                   
                    for (new j=last;j<newpos;j++)
                    {
                        format(values_float[k],9,"%s%s",values_float[k],value_string_float[j])
                    }
                   
                    last = newpos + 1
                    k++
                }
            }
           
            new bool:ok=false
            new counter = 0
           
            for (new i=0;i<k;i++)
            {
                counter++
               
                true_value_float[i] = str_to_float(values_float[i])
               
                if (ok == true)
                {
                    set_pcvar_float(pcvars[Option:cvar],true_value_float[i])
                    counter = 0
                    break
                }
               
                if (true_value_float[i] == get_option_float(Option:cvar))
                    ok = true
            }
           
            if (counter == k)
                set_pcvar_float(pcvars[Option:cvar],true_value_float[0])
        }
    }
   
    menu_destroy(menu)
    menu_adjust(id, floatround(float(item)/7.0,floatround_floor))
    save_cfg()
    return PLUGIN_HANDLED
}

// Cache the sound
public plugin_precache()
{
    engfunc(EngFunc_PrecacheSound,"radio/bot/im_blind.wav")
}

// Round end
public event_round_end()
{
    static players[32],num,id
    get_players(players, num)
   
    for (new i=0;i<num;i++)
    {
        id = players[i]
       
        if (g_round_lock[id] > 0  && g_counter_in_effect[id] == false)
            g_round_lock[id] -= 1
       
        if (g_round_lock[id] == 0 && get_option(pc_frc_mode) == 1 && g_counter_in_effect[id] == false)
        {
            g_reset_counter[id] = false
            g_counter_in_effect[id] = true
            g_flash_mon[id] = 0
        }
    }
}

// Reset the monitor when a player connects or disconnects
public client_disconnect(id)
{
    g_reset_counter[id] = true
}

public client_connect(id)
{
    g_reset_counter[id] = true
}

// Damn you!!! You flashed me!!!
public event_blinded(id)
{
    new alpha = read_data(7)
   
    if (!is_user_alive(id) || g_flasher == 0)
        return PLUGIN_CONTINUE
   
    // And now the news!
    return show_news(id,alpha,g_flasher)
}

public event_override(id)
{
    if (get_option(pc_frc_mcolor) == 0)
        return PLUGIN_CONTINUE
   
    if (get_option(pc_frc_mcolor) != 3)
        flash(id,read_data(1),read_data(2),read_data(3),g_color_red,g_color_green,g_color_blue,read_data(7))
    else
        flash(id,read_data(1),read_data(2),read_data(3),random_num(0,255),random_num(0,255),random_num(0,255),read_data(7))
   
    return PLUGIN_CONTINUE
}

// Show the news!
public show_news(id,alpha,id_fl)
{   
    // If you flash a teammate
    if (g_team_pl[id] == g_team_pl[id_fl] && id != id_fl)
    {
        new message1[128], message2[128]
        new flasher[32], name[32]
       
        get_user_name(id_fl, flasher, 31)
        get_user_name(id, name, 31)
       
        format(message1, 127, "^x04[Team Flash Control]^x01 %L ^x03%s", id, "THE_FLASHED_MSG", flasher)
        format(message2, 127, "^x04[Team Flash Control]^x01 %L ^x03(%s)",id_fl,alpha == BLINDED_FULLY ? "FLASHER_MSG_TOTAL" : "FLASHER_MSG_PART", name)
       
        colored_msg(id,message1)
        colored_msg(id_fl,message2)
       
        if (!is_user_bot(id_fl) && get_option(pc_frc_punish) && g_counter_in_effect[id_fl] == true && (alpha == BLINDED_FULLY || (get_option(pc_frc_count) && alpha != BLINDED_FULLY)))
        {
            g_flash_mon[id_fl] += 1
           
            if (g_flash_mon[id_fl] == get_option(pc_frc_limit))
            {
                g_counter_in_effect[id_fl] = false
                switch (get_option(pc_frc_mode))
                {
                    case 1: g_round_lock[id_fl] = floatround(get_option_float(pc_frc_nr_ctr),floatround_round)
                    case 2: g_time_lock[id_fl]  = get_gametime() + (get_option_float(pc_frc_nr_ctr) * 60.0)
                }
               
                if(get_option(pc_frc_admin) && get_option(pc_frc_punish))
                {
                    new msg[128]
                    format(msg,127,"%L",LANG_SERVER,"BLOCK_USER_FLASH_MSG",flasher)
                    admin_message("[Team Flash Control]",msg)
                }
               
            }
        }
       
        if (g_flash_mon[id_fl] == get_option(pc_frc_limit) && alpha == BLINDED_FULLY)
            switch (get_option(pc_frc_type))
            {
                case 1: user_kill(id_fl)
                case 2: eflash(id_fl, 10<<12, 1<<12, 0x0000 , 255, 255, 255, 255)
            }
       

        if(get_option(pc_frc_sound))
            client_cmd(id_fl,"spk sound/radio/bot/im_blind.wav")
       
        if(alpha == BLINDED_FULLY && get_option(pc_frc_admin))
        {
            new msg[128]
            format(msg,127,"%L",LANG_SERVER,"ADMIN_MSG",flasher,name)
            admin_message("[Team Flash Control]",msg)
        }
    }
   
    return PLUGIN_CONTINUE
}

// Player prethink
public fw_player_prethink(id)
{
    if (!is_user_alive(id))
        return FMRES_IGNORED
   
    // Get the team of the player
    new team = get_pdata_int(id,OFFSET_TEAM,OFFSET_LINUX)
   
    if (team != g_team_pl[id])
        g_team_pl[id] = team
   
    if (g_reset_counter[id] == true)
    {
        g_reset_counter[id] = false
        g_counter_in_effect[id] = true
        g_flash_mon[id] = 0
    }
   
    if (get_gametime() >= g_time_lock[id] && get_option(pc_frc_mode) == 2 && g_counter_in_effect[id] == false)
    {
        g_reset_counter[id] = false
        g_counter_in_effect[id] = true
        g_flash_mon[id] = 0
    }
   
    if (get_user_weapon(id) == CSW_FLASHBANG && pev(id,pev_button) & IN_ATTACK && g_flash_mon[id] == get_option(pc_frc_limit) && get_option(pc_frc_punish) && get_option(pc_frc_type) == 0)
    {
        set_pev(id,pev_button,pev(id,pev_button) & ~IN_ATTACK)
        return FMRES_HANDLED
    }
   
    return FMRES_IGNORED
}

// The moment the flash is thrown
public fw_setmodel(ent,const model[])
{
    if (!pev_valid(ent))
        return FMRES_IGNORED
   
    // Not yet thrown
    if (pev_float(ent,pev_gravity) == 0.0)
        return FMRES_IGNORED
   
    if (containi(model,"w_flashbang.mdl") == -1)
        return FMRES_IGNORED
   
    // Get the owner   
    g_ent_owner[ent] = pev(ent,pev_owner)
   
    return FMRES_IGNORED
}

// The grenade thinks ... quiet!!!
public fw_think(ent)
{
    if (!is_flash(ent) || g_flash_ent == ent)
        return FMRES_IGNORED
   
    // The flash has not kaboomed
    if (pev_float(ent,pev_dmgtime) > get_gametime())
        return FMRES_IGNORED
   
    g_flasher = g_ent_owner[ent]
    g_flash_ent = ent
    new Float:origin[3]
    pev(ent,pev_origin,origin)
   
    if (get_option(pc_frc_selfb) != 0)
        g_block_flash[g_flasher] = true
   
    if (get_option(pc_frc_block) != 0)
    {
        for (new i=0;i<33;i++)
        {
            if (i != g_flasher && g_team_pl[i] == g_team_pl[g_flasher])
                g_block_flash[i] = true
        }
    }
   
    if (get_option(pc_frc_blocka) != 0)
    {
        new Float:user_origin[3],Float:angles[3]
        new hit,trace
       
        while ((hit = engfunc(EngFunc_FindEntityInSphere, hit, origin, 1500.0)))
        {
            if (!is_user_alive(hit) || g_team_pl[hit] != g_team_pl[g_flasher] || g_flasher == hit)
                continue
           
            // Get the origin of the players head
            engfunc(EngFunc_GetBonePosition, hit, BONE_HEAD, user_origin, angles)
           
            // Traceline from the player origin to the grenade origin
            engfunc(EngFunc_TraceLine, origin, user_origin, DONT_IGNORE_MONSTERS, ent, trace)
           
            if (get_tr2(trace,TR_pHit) == hit)
            {
                g_allow_forward = false
                break
            }
        }
    }
   
    switch (get_option(pc_frc_mcolor))
    {
        case 1:
        {
            g_color_red  = get_option(pc_frc_rcolor)
            g_color_green = get_option(pc_frc_gcolor)
            g_color_blue  = get_option(pc_frc_bcolor)
        }
        case 2:
        {
            g_color_red  = random_num(0,255)
            g_color_green = random_num(0,255)
            g_color_blue  = random_num(0,255)
        }
        default:
        {
            g_color_red  = 255
            g_color_green = 255
            g_color_blue  = 255
        }
    }
   
    return FMRES_IGNORED
}

// The grenade emits the explosion sound
public fw_emitsound(ent,chan,const sound[])
{
    if (!pev_valid(ent))
        return FMRES_IGNORED
   
    if (contain(sound, "flash") == -1)
        return FMRES_IGNORED
   
    static classname[32]
    pev(ent, pev_classname, classname, 31)
    if (!equal(classname, "grenade"))
        return FMRES_IGNORED
   
    // Good time to reset the flasher and the ent id
    g_flash_ent = 0
    g_flasher = 0
    g_allow_forward = true
   
    if (task_exists(g_ent_owner[ent] + REMAIN_TASK))
        remove_task(g_ent_owner[ent] + REMAIN_TASK)
   
    // Show the user how many flashes he has left to throw before before beeing blocked
    set_task(0.2,"remaining_flashes",g_ent_owner[ent] + REMAIN_TASK)
   
    // Good time to reset the owner of the entity and the flashed players
    g_ent_owner[ent] = 0
   
    for (new i=0;i<33;i++)
    {
        g_block_flash[i] = false
    }
   
    if (get_option(pc_frc_dlight) != 0)
    {
        new Float:origin[3]
        pev(ent,pev_origin,origin)
       
        switch (get_option(pc_frc_mcolor))
        {
            case 0,3:
            {
                dynamic_light(origin)
            }
            case 1,2:
            {
                dynamic_light(origin,g_color_red,g_color_green,g_color_blue)
            }
            default:
            {
                dynamic_light(origin)
            }
        }
    }
   
    return FMRES_IGNORED
}

// Let's find the victims
public fw_findentityinsphere(start, Float:origin[3], Float:radius)
{
    if (radius != 1500.0 || g_flash_ent == 0)
        return FMRES_IGNORED
   
    if (g_allow_forward == false)
    {
        forward_return(FMV_CELL,-1)
        return FMRES_SUPERCEDE
    }
   
    static hit, trace, Float:user_origin[3], Float:fraction, Float:angles[3]
   
    if (get_option(pc_frc_bug) != 0)
    {
        while ((hit = engfunc(EngFunc_FindEntityInSphere, hit, origin, radius)))
        {
            // Hit a non- or dead-player
            if (!is_user_alive(hit))
            {
                forward_return(FMV_CELL, hit)
                return FMRES_SUPERCEDE
            }
           
            // Get the origin of the players head
            engfunc(EngFunc_GetBonePosition, hit, BONE_HEAD, user_origin, angles)
           
            // Traceline from the player origin to the grenade origin
            engfunc(EngFunc_TraceLine, user_origin, origin, DONT_IGNORE_MONSTERS, hit, trace)
           
            get_tr2(trace, TR_flFraction, fraction)
           
            // If the trace didn't hit anything in it's way then we're cool!
            if (fraction == 1.0 && g_block_flash[hit] == false)
            {
                forward_return(FMV_CELL, hit)
                return FMRES_SUPERCEDE
            }
        }
    }
    else
    {
        while ((hit = engfunc(EngFunc_FindEntityInSphere, hit, origin, radius)))
        {
            if (!is_user_alive(hit))
            {
                forward_return(FMV_CELL, hit)
                return FMRES_SUPERCEDE
            }
           
            if (g_block_flash[hit] == false)
            {
                forward_return(FMV_CELL, hit)
                return FMRES_SUPERCEDE
            }
        }
    }
   
    // Cancel the check, if nothing was hit
    forward_return(FMV_CELL, -1)
    return FMRES_SUPERCEDE
}

// We are in trouble!
public remaining_flashes(id)
{
    id -= REMAIN_TASK
   
    if (!(get_option(pc_frc_admin) != 0 && get_option(pc_frc_limit) >= g_flash_mon[id] >= (get_option(pc_frc_limit) - 2) && get_option(pc_frc_punish) != 0 && get_option(pc_frc_warn) != 0))
        return PLUGIN_CONTINUE
   
    new message[128]
   
    format(message,127,"^x04[Team Flash Control] ^x01%L ^x03%d ", id, "FLASHER_MSG_LEFT1",get_option(pc_frc_limit) - g_flash_mon[id] + 1)
    format(message,127,"%s^x01%L",message, id, "FLASHER_MSG_LEFT2")
   
    colored_msg(id,message)
   
    return PLUGIN_CONTINUE
}

// Is the entity a flash grenade??? hmmm...
public bool:is_flash(ent)
{
    if (!pev_valid(ent)) return false
    static classname[32]
    static model[32]
    pev(ent, pev_classname, classname, 31)
    pev(ent,pev_model,model,31)
    return (equal(classname, "grenade") && containi(model,"w_flashbang.mdl") != -1) ? true : false
}

// The dynamic light of the flashbang, it adds a little bit of realism
dynamic_light(Float:origin[3], red = 255, green = 255, blue = 255)
{
    message_begin(MSG_BROADCAST,SVC_TEMPENTITY)
    write_byte(TE_DLIGHT) // The light effect
    engfunc(EngFunc_WriteCoord,origin[0]) // x
    engfunc(EngFunc_WriteCoord,origin[1]) // y
    engfunc(EngFunc_WriteCoord,origin[2]) // z
    write_byte(75) // radius
    write_byte(red) // r
    write_byte(green) // g
    write_byte(blue) // b
    write_byte(4) // life
    write_byte(120) // decay rate
    message_end()
}

// The colored flash! The more colors the better
flash(id, duration, holdtime, flags, red = 255, green = 255, blue = 255, alpha)
{
    message_begin(MSG_ONE, scrfade, {0,0,0}, id)
    write_short(duration)
    write_short(holdtime)
    write_short(flags)
    write_byte(red)
    write_byte(green)
    write_byte(blue)
    write_byte(alpha)
    message_end()
}

eflash(id, duration, holdtime, flags, red = 255, green = 255, blue = 255, alpha)
{
    emessage_begin(MSG_ONE, scrfade, {0,0,0}, id)
    ewrite_short(duration)
    ewrite_short(holdtime)
    ewrite_short(flags)
    ewrite_byte(red)
    ewrite_byte(green)
    ewrite_byte(blue)
    ewrite_byte(alpha)
    emessage_end()
}

// Just the colored message ...  don't you like colors?
public colored_msg(id,msg[])
{
    message_begin(MSG_ONE, saytext, {0,0,0}, id)
    write_byte(id)
    write_string(msg)
    message_end()
}

// Similar to pev() just returns a float value
public Float:pev_float(index,type)
{
    new Float:nr
    pev(index,type,nr)
    return nr
}

// Message to admins, they need to know ...
public admin_message(const name[], const message[])
{
    new message2[192]
    static players[32],num
    get_players(players, num)
   
    format(message2, 191, "(ADMINS) %s : %s", name, message)
   
    for (new i = 0; i < num; ++i)
    {
        if (access(players[i], ADMIN_CHAT))
            client_print(players[i], print_chat, "%s", message2)
    }
}

// Control panel system functions/stocks
register_option(Option:option, const name[300], const string[], OptionType:type = OPTION_TOGGLE, flags = 0, Float:value = 0.0)
{
    pcvars[option] = register_cvar(name, string, flags, value)
    option_type[option] = type
    option_information[option] = name
}

register_option_value(Option:option, values[100])
{
    if (option_type[option] == OPTION_TOGGLE)
        return
   
    option_value[option] = values
}

public get_option(Option:option)
{
    return get_pcvar_num(pcvars[option])
}

public toggle_option(Option:option)
{
    set_pcvar_num(pcvars[option], !get_option(option))
}

public Float:get_option_float(Option:option)
{
    return get_pcvar_float(pcvars[option])
}

public set_option_float(Option:option, Float:set_to)
{
    set_pcvar_float(pcvars[option], set_to)
}


public set_option_cell(Option:option, set_to)
{
    set_pcvar_num(pcvars[option], set_to)
}


ot_207 02-23-2009 10:41

Re: Flashbang Remote Control v9.1
 
Thanks :). Will add multilang support to that menu in the future.

crazyeffect 03-11-2009 13:17

Re: Flashbang Remote Control v9.1
 
Dutch translation:

Quote:

[en]
FLASHER_MSG_PART = Je heb een teammaat blind gemaakt
FLASHER_MSG_TOTAL = Je hebt een teammade helemaal blind gemaakt
THE_FLASHED_MSG = Je bent geblindeerd door
ADMIN_MSG = %s heeft een teammaat verblind (%s)
BLOCK_USER_FLASH_MSG = %s is gestraft omdat hij te veel teammaten verblind heeft
FLASHER_MSG_LEFT1 = Als je nog 1
FLASHER_MSG_LEFT2 = teammaat verblind word je gestraft!

ot_207 04-03-2009 09:42

Re: Flashbang Remote Control v9.1
 
Quote:

Originally Posted by crazyeffect (Post 778552)
Dutch translation:

Thanks :)

3JIou-TaTapuH 06-07-2009 20:40

Re: Flashbang Remote Control v9.1
 
This plugin is outstanding

Alexik 08-09-2009 05:41

Re: Flashbang Remote Control v9.1
 
I just got some error that made my server crash.

Code:

L 08/09/2009 - 06:01:57: Start of error session.
L 08/09/2009 - 06:01:57: Info (map "fy_snow_orange") (file "addons/amxmodx/logs/error_20090809.log")
L 08/09/2009 - 06:01:57: [AMXX] Displaying debug trace (plugin "flashbang_remote_control.amxx")
L 08/09/2009 - 06:01:57: [AMXX] Run time error 4: index out of bounds
L 08/09/2009 - 06:01:57: [AMXX]    [0] 31789.attach::fw_setmodel (line 698)
L 08/09/2009 - 06:01:58: [AMXX] Displaying debug trace (plugin "flashbang_remote_control.amxx")
L 08/09/2009 - 06:01:58: [AMXX] Run time error 4: index out of bounds
L 08/09/2009 - 06:01:58: [AMXX]    [0] 31789.attach::fw_think (line 713)
L 08/09/2009 - 06:01:58: [AMXX]    [1] 31789.attach::fw_think (line 710)
L 08/09/2009 - 06:01:58: [AMXX] Displaying debug trace (plugin "flashbang_remote_control.amxx")
L 08/09/2009 - 06:01:58: [AMXX] Run time error 4: index out of bounds
L 08/09/2009 - 06:01:58: [AMXX]    [0] 31789.attach::fw_think (line 713)
L 08/09/2009 - 06:01:58: [AMXX]    [1] 31789.attach::fw_think (line 710)
L 08/09/2009 - 06:01:58: [AMXX] Displaying debug trace (plugin "flashbang_remote_control.amxx")
L 08/09/2009 - 06:01:58: [AMXX] Run time error 4: index out of bounds
L 08/09/2009 - 06:01:58: [AMXX]    [0] 31789.attach::fw_emitsound (line 798)

The thing is the sound is disabled (even though, the sound is where it should be). Everything except the "block_team_flash" option is disabled (the dynamic light, the colors, everything except that options).

What is there to do ? (I know this might not be answered, but who knows).

Thank you,

Alex.

Jack86 08-09-2009 05:59

Re: Flashbang Remote Control v9.1
 
If u want only that feature use some plugin like this one http://forums.alliedmods.net/showthread.php?t=16992

Alexik 08-09-2009 07:20

Re: Flashbang Remote Control v9.1
 
Quote:

Originally Posted by Jack86 (Post 894098)
If u want only that feature use some plugin like this one http://forums.alliedmods.net/showthread.php?t=16992

I was using that as well but wasn't working (don't know why, just wasn't working, no errors and such). I also tried several others no team flash scripts that I found around several scripting forums and so on. This is the only one that does its job for me. That is why I keep using that only feature :)

But thank you for your reply.

I'm hoping someone will look into the error though.

ot_207 08-09-2009 14:12

Re: Flashbang Remote Control v9.1
 
Quote:

Originally Posted by Alexik (Post 894083)
I just got some error that made my server crash.

Code:

L 08/09/2009 - 06:01:57: Start of error session.
L 08/09/2009 - 06:01:57: Info (map "fy_snow_orange") (file "addons/amxmodx/logs/error_20090809.log")
L 08/09/2009 - 06:01:57: [AMXX] Displaying debug trace (plugin "flashbang_remote_control.amxx")
L 08/09/2009 - 06:01:57: [AMXX] Run time error 4: index out of bounds
L 08/09/2009 - 06:01:57: [AMXX]    [0] 31789.attach::fw_setmodel (line 698)
L 08/09/2009 - 06:01:58: [AMXX] Displaying debug trace (plugin "flashbang_remote_control.amxx")
L 08/09/2009 - 06:01:58: [AMXX] Run time error 4: index out of bounds
L 08/09/2009 - 06:01:58: [AMXX]    [0] 31789.attach::fw_think (line 713)
L 08/09/2009 - 06:01:58: [AMXX]    [1] 31789.attach::fw_think (line 710)
L 08/09/2009 - 06:01:58: [AMXX] Displaying debug trace (plugin "flashbang_remote_control.amxx")
L 08/09/2009 - 06:01:58: [AMXX] Run time error 4: index out of bounds
L 08/09/2009 - 06:01:58: [AMXX]    [0] 31789.attach::fw_think (line 713)
L 08/09/2009 - 06:01:58: [AMXX]    [1] 31789.attach::fw_think (line 710)
L 08/09/2009 - 06:01:58: [AMXX] Displaying debug trace (plugin "flashbang_remote_control.amxx")
L 08/09/2009 - 06:01:58: [AMXX] Run time error 4: index out of bounds
L 08/09/2009 - 06:01:58: [AMXX]    [0] 31789.attach::fw_emitsound (line 798)

The thing is the sound is disabled (even though, the sound is where it should be). Everything except the "block_team_flash" option is disabled (the dynamic light, the colors, everything except that options).

What is there to do ? (I know this might not be answered, but who knows).

Thank you,

Alex.

Do you have the latest version, if yes then give me the output of these commands: meta list, amxx plugins, amxx version.
Also give me the cfg file of the plugin if you can.

Alexik 08-09-2009 19:00

Re: Flashbang Remote Control v9.1
 
Quote:

Originally Posted by ot_207 (Post 894473)
Do you have the latest version, if yes then give me the output of these commands: meta list, amxx plugins, amxx version.
Also give me the cfg file of the plugin if you can.

meta list:
Code:

Currently running plugins:
 [  1] AMX Mod X, v1.8.1.3711, Apr 26 2008, by AMX Mod X Dev Team, see http://www.amxmodx.org
 [  2] cbooster, v0.01, 2008/04/06, by , see
 [  3] SQLite, v1.8.0.3660, Oct 25 2007, by AMX Mod X Dev Team, see http://www.amxmodx.org/
 [  4] Fun, v1.8.0.3660, Oct 25 2007, by AMX Mod X Dev Team, see http://www.amxmodx.org
 [  5] Engine, v1.8.0.3660, Oct 25 2007, by AMX Mod X Dev Team, see http://www.amxmodx.org
 [  6] FakeMeta, v1.8.0.3660, Oct 25 2007, by AMX Mod X Dev Team, see http://www.amxmodx.org
 [  7] CStrike, v1.76, Mar  8 2007, by AMX Mod X Dev Team, see http://www.amxmodx.org
 [  8] CSX, v1.76c, Mar  8 2007, by AMX Mod X Dev Team, see http://www.amxmodx.org/
 [  9] Ham Sandwich, v1.8.0.3660, Oct 25 2007, by AMX Mod X Dev Team, see http://www.amxmodx.org
 [ 10] CSDM2, v2.1.2, Oct 25 2008, by CSDM Team, see http://www.bailopan.net/

amxx plugins:
Code:

Currently loaded plugins:
      name                    version    author            file            status 
 [  1] Admin Base              1.8.1.3746  AMXX Dev Team    admin.amxx      running 
 [  2] Admin Commands          1.8.0.3660  AMXX Dev Team    admincmd.amxx    running 
 [  3] Admin Help              1.8.1.3746  AMXX Dev Team    adminhelp.amxx  running 
 [  4] Slots Reservation      1.8.1.3746  AMXX Dev Team    adminslots.amxx  running 
 [  5] Multi-Lingual System    1.8.1.3746  AMXX Dev Team    multilingual.am  running 
 [  6] Menus Front-End        1.8.1.3746  AMXX Dev Team    menufront.amxx  running 
 [  7] Commands Menu          1.8.1.3746  AMXX Dev Team    cmdmenu.amxx    running 
 [  8] Players Menu            1.8.1.3746  AMXX Dev Team    plmenu.amxx      running 
 [  9] Teleport Menu          1.8.1.3746  AMXX Dev Team    telemenu.amxx    running 
 [ 10] Maps Menu              1.8.1.3746  AMXX Dev Team    mapsmenu.amxx    running 
 [ 11] Plugin Menu            1.8.1.3746  AMXX Dev Team    pluginmenu.amxx  running 
 [ 12] Admin Chat              1.8.1.3746  AMXX Dev Team    adminchat.amxx  running 
 [ 13] Anti Flood              1.8.1.3746  AMXX Dev Team    antiflood.amxx  running 
 [ 14] Scrolling Message      1.8.1.3746  AMXX Dev Team    scrollmsg.amxx  running 

 [ 15] Info. Messages          1.8.1.3746  AMXX Dev Team    imessage.amxx    running 
 [ 16] Admin Votes            1.8.1.3746  AMXX Dev Team    adminvote.amxx  running 
 [ 17] NextMap                1.8.1.3746  AMXX Dev Team    nextmap.amxx    running 
 [ 18] Nextmap Chooser        1.8.1.3746  AMXX Dev Team    mapchooser.amxx  running 
 [ 19] TimeLeft                1.8.1.3746  AMXX Dev Team    timeleft.amxx    running 
 [ 20] Pause Plugins          1.8.1.3746  AMXX Dev Team    pausecfg.amxx    running 
 [ 21] Stats Configuration    1.8.1.3746  AMXX Dev Team    statscfg.amxx    running 
 [ 22] Restrict Weapons        1.8.1.3746  AMXX Dev Team    restmenu.amxx    running 
 [ 23] StatsX                  1.8.1.3746  AMXX Dev Team    statsx.amxx      running 
 [ 24] CS Misc. Stats          1.8.1.3746  AMXX Dev Team    miscstats.amxx  running 
 [ 25] CS Stats Logging        1.8.1.3746  AMXX Dev Team    stats_logging.a  running 
 [ 26] AMX Mod Compat Engine  1.76.rc4    AMXX Dev Team    amxmod_compat.a  running 
 [ 27] Flash Remote Control    9.1        OT                flashbang_remot  debug   
 [ 28] Ghostchat              0.3        NetRipper        ghostchat.amxx  debug   
 [ 29] Admin Spectator ESP    fm_1.5_bet  KoST              admin_spec_esp_  debug   

 [ 30] ShowIP                  1.08        Spunky            showip.amxx      debug   
 [ 31] MultiJump              1.1        twistedeuphoria  multijump.amxx  debug   
 [ 32] Roundend Blocker        1.1.065    Nextra            roundend_blocke  debug   
 [ 33] Spec or Join            1.0        FireW@ll          Spec_Or_Join.am  debug   
 [ 34] Vampire                1.2.0      ConnorMcLeod      vampire.amxx    debug   
 [ 35] CSDM Teambalancer      1.1c        DA                csdm_teambalanc  debug   
 [ 36] Ban Config              1.0        Alka              amx_bancfg.amxx  debug   
 [ 37] Hack Hunter            1.1RC1      Alka & SAMURAI    hack_hunter_bet  debug   
 [ 38] Hobo AFK Manager        1.2a        hoboman313        hobo_afk_manage  debug   
 [ 39] CSDM Main              2.1.1      CSDM Team        csdm_main.amxx  running 
 [ 40] CSDM Equip              2.1.1      CSDM Team        csdm_equip.amxx  running 
 [ 41] CSDM Mod                2.1.1      CSDM Team        csdm_spawn_pres  running 
 [ 42] CSDM Misc              2.1.1      CSDM Team        csdm_misc.amxx  running 
 [ 43] CSDM Protection        2.1.1      BAILOPAN          csdm_protection  running 
43 plugins, 43 running

amxx version:
Code:

AMX Mod X 1.8.1.3711
Authors:
        David "BAILOPAN" Anderson, Pavol "PM OnoTo" Marko, Felix "SniperBeamer" Geyer
        Jonny "Got His Gun" Bergstrom, Lukasz "SidLuke" Wlasinski
        Christian "Basic-Master" Hammacher, Borja "faluco" Ferrer
        Scott "Damaged Soul" Ehlert
Compiled: Apr 26 2008, 00:00:22
URL:http://www.amxmodx.org/

plugin cfg:
Code:

frc_sound 0
frc_adminchat 0
frc_block_team_flash 1
frc_block_self_flash 0
frc_block_special_flash 0
frc_flasher_punish 0
frc_flasher_counter 0
frc_flasher_mistake_allow 0
frc_flasher_warn 0
frc_flasher_punish_mode 2
frc_flasher_punish_type 1
frc_flasher_punish_control 2
frc_bug_fix 0
frc_color_mode 0

This is about everything you asked for :)

PS: amx_bancfg, the afk manager, spec or join, esp, multijump, etc...all these plugins (except CSDM and flashbang remote control) were added after the frc, if it helps with anything (as in the errors were happening before those scripts, so it's either CSDM or the frc itself)

ot_207 08-10-2009 04:16

Re: Flashbang Remote Control v9.1
 
There are 2 things that you can try.
1. Update your amxx to the latest version IE 1.8.1, all the modules and the plugins, if it does not show the error then we are cool, if not try the second one.
2. Change in the plugin code
PHP Code:

#define MAX_ENT         1126 

->
PHP Code:

#define MAX_ENT         4100 

Some questions. What Operating System do you have? X64 or X32? Steam or no-steam?

Alexik 08-10-2009 04:51

Re: Flashbang Remote Control v9.1
 
Quote:

Originally Posted by ot_207 (Post 895088)
There are 2 things that you can try.
1. Update your amxx to the latest version IE 1.8.1, all the modules and the plugins, if it does not show the error then we are cool, if not try the second one.
2. Change in the plugin code
PHP Code:

#define MAX_ENT         1126 

->
PHP Code:

#define MAX_ENT         4100 

Some questions. What Operating System do you have? X64 or X32? Steam or no-steam?

AMXX was supposed to be 1.8.1, but I will try to reinstall it (I do not have full superuser access to the server, this is a rented one).
The server is running CentOS release 5.3 (Final), x86, Intel Q9550 CPU, Steam.

LE: I updated amxx (still the Fun and Hamsandwich modules appear to be v1.8.0.3) to 1.8.1 (just downloaded from the AMXX website and uploaded all the files, then started the server again). Will wait to see if the server crashes again. If it will, I will try the second method by editing the plugin code.

Thanks

ot_207 08-12-2009 10:08

Re: Flashbang Remote Control v9.5
 
Updated to version 9.5

Changelog:
PHP Code:

*  9.5  - new method of remembering the ownerLow on memory usage

What is new?
- No need to edit plugin code for more entities (it is dynamic now)
- New method of registering owner

alias_retaer 08-24-2009 17:12

Re: Flashbang Remote Control v9.5
 
Here is a bulgarian translation.

Code:

[bg]
FLASHER_MSG_PART =  Ti flashna suotbornik
FLASHER_MSG_TOTAL = Ti napulno flashna suotbornik

THE_FLASHED_MSG = Ti beshe flashnat ot

ADMIN_MSG = %s flashna suotbornik (%s)
BLOCK_USER_FLASH_MSG = %s beshe nakazan zashtoto flashna prekaleno mnogo suotbornici

FLASHER_MSG_LEFT1 = Ako flashnesh
FLASHER_MSG_LEFT2 = poveche suotbornici shte budesh nakazan


Sumalenin 09-06-2009 10:19

Re: Flashbang Remote Control v9.5
 
My Lan-Server doent work with this Plugin!
By "Parsing Game Info" Crached ....

ot_207 09-07-2009 03:36

Re: Flashbang Remote Control v9.5
 
Quote:

Originally Posted by Sumalenin (Post 924814)
My Lan-Server doent work with this Plugin!
By "Parsing Game Info" Crached ....

Output of these commands: meta list and amxx plugins.

nisam_ja 09-07-2009 14:08

Re: Flashbang Remote Control v9.5
 
good job ^^


All times are GMT -4. The time now is 10:25.

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