Raised This Month: $32 Target: $400
 8% 

[INC] Flashbang Remote Control API [Flash events]


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-10-2009 , 09:46   [INC] Flashbang Remote Control API [Flash events]
Reply With Quote #1

Description:
These forwards to work you need to have this plugin working on your server.
Some forwards will run even if the plugin is turned off (by cvar not by pause!!!) or are influenced by plugin cvars.
PHP Code:
/* Flashbang Remote Control Include File
*  Author: OT
*  
*  This include file will only work if the plugin named as flashbang_remote_control is placed in your server and it is working!
*/ 
What does this api offer?

Forwards:
PHP Code:
/* Forwards */

/*
* This forward is called before the flash message is sent to the player.
* Will execute in all plugins, even if it is blocked!

* Arguments:
* flasher - the owner of the flashbang
* flashed - the person who was flashed
* flashbang - the flashbang entity | this entity will be equal with flasher if called with FRC_flash_player
* amount - the alpha of the screenfade

* Return:
* - FRC_CONTINUE - do nothing
* - FRC_MAKE_PARTIALLY - make the flashbang partial
* - FRC_MAKE_FULLY - make the flashbang fully
* - FRC_BLOCK - block it

* Notes: Will work even if plugin is turned off!
* Notes: Here you can manipulate also the duration of the screenfade with [g|s]et_FRC_duration() native
*/

forward fw_FRC_preflash(flasherflashedflashbangamount)

/*
* This forward is called after the flash message is sent to the player.
* This forward can not be blocked and will not execute if preflash is blocked!

* Arguments:
* flasher - the owner of the flashbang
* flashed - the person who was flashed
* flashbang - the flashbang entity | this entity will be equal with flasher if called with FRC_flash_player
* amount - the alpha of the screenfade

* Return:
* No return!

* Notes: Will work even if plugin is turned off!
*/

forward fw_FRC_postflash(flasherflashedflashbangamount)

/*
* This forward is called when the flashbang begins searching for players, aka explodes.
* Before this forward the plugin registers all the
* It can't be blocked.

* Arguments:
* flashbang_entity - the flashbang entity
* owner - the entity owner

* Return:
* No return!

* Notes: Will work even if plugin is turned off!
*/

forward fw_FRC_flashbang_explosion(flashbang_entityowner)

/*
* This forward is called when the plugin free the data such as flasher entity and flash owner

* Return:
* No return!

* Notes: Will work even if plugin is turned off!
*/

forward fw_FRC_free_plugin_data()

/*
* This forward is called when the plugin punished a player!
* Warning it punish_type is equal to PUNISH_ATTACK then this forward will be extremely often called!

* Arguments:
* flasher - the person that needs to be punished
* punish_type - type of punishment use the Punish enum!

* Return:
* FRC_CONTINUE - continue the punishment
* FRC_BLOCK - block the punishment

* Notes: Will work only when the plugin has the punish system on and the plugin itself is turned on!
*/

forward fw_FRC_punish(flasherpunish_type)

/*
* This forward is called when the plugin does the special check to block flashing players if one teammate is flashed!

* Arguments:
* start - start position of the trace
* end - end position of the trace
* conditions - this should normally be DONT_IGNORE_MONSTERS, this acts as the conditions of TraceLine
* ignore_ent - entity that is to be ignored
* trace_handle - use get_tr2() from fakemeta, here we have the info that we need! 
*              - This is the tracehandle of the plugin, any modifications will be seen!

* Return:
* No return!

* Notes: Will work when the plugin is on and has the special block feature on!
*/

forward fw_FRC_trace(Float:start[3], Float:end[3], conditionsignore_enttrace_handle)

/*
* This forward is called when the plugin does the bug check to see if a player is flashable through a trace!

* Arguments:
* start - start position of the trace
* end - end position of the trace
* conditions - this should normally be DONT_IGNORE_MONSTERS, this acts as the conditions of TraceLine
* ignore_ent - entity that is to be ignored
* trace_handle - use get_tr2() from fakemeta, here we have the info that we need! 
*              - This is the tracehandle of the plugin, any modifications will be seen!

* Return:
* No return!

* Notes: Will work when the plugin is on and has the bugfix feature on!
*/

forward fw_FRC_trace_bug(Float:start[3], Float:end[3], conditionsignore_enttrace_handle)

/*
* This forward is called when the counter is reseted.
* This happens normally when client connects or the punish period has finished!

* Return:
* No return!

* Notes: Will work only when the plugin has the punish system on and the plugin itself is turned on!
*/

forward fw_FRC_counter_reset(player)

/*
* This forward is called when the flashbang searches for the players that can be flashed!
* This takes place after fw_FRC_flashbang_explosion forward.
* If this will be blocked none of the punish/flash/trace forwards will work!

* Params:
* - player - player id
* - flash_entity - flashbang entity

* Return:
* - FRC_CONTINUE - do not do anything
* - FRC_BLOCK - block the client from beeing searched

* Notes: Will work even if plugin is turned off!
*/

forward fw_FRC_flash_find_in_sphere(playerflash_entity
Natives:
PHP Code:

/* Natives */

/*
* Gets the number of times a player has flashed his teammates
*/
native get_FRC_counter(id)

/*
* Sets the number of times a player has flashed his teammates
*/
native set_FRC_counter(idquantity)

/*
* This will set the duration of the flash [Use this in fw_FRC_preflash forward!]
* Return is in 0.1 seconds!
* Will return -1 on invalid call!
*/
native get_FRC_duration(flashed)

/*
* This will set the duration of the flash [Use this in fw_FRC_preflash forward!]
* Duration is in 0.1 seconds!
* Will return -1 on invalid call!
*/
native set_FRC_duration(flashedduration)

/*
* This will set the hold time of the flash [Use this in fw_FRC_preflash forward!]
* Return is in 0.1 seconds!
* Will return -1 on invalid call!
*/
native get_FRC_holdtime(flashed)

/*
* This will set the hold time of the flash [Use this in fw_FRC_preflash forward!]
* Duration is in 0.1 seconds!
* Will return -1 on invalid call!
*/
native set_FRC_holdtime(flashedduration)

/*
* Gets the number of time a player can flash his teammates
*/
native get_FRC_flash_limit()

/*
* Gets the exploding flashbang entity
*/
native get_FRC_exploding_flash()

/*
* Gets the owner of the exploding flashbang
*/
native get_FRC_exploding_owner()

/*
* If flasher != 0 then this function will be hookable with fw_FRC_preflash and fw_FRC_postflash, and the flash entity will be equal with flasher!
* If flasher == 0 then this function will be unhookable

* Params:
* holdtime: Time that the screenfade maintains its color before fading
* duration: The time the entire screenfade message will last.
* Both duration and holdtime are in 0.1 seconds!!!

* Example usage:
* FRC_flash_player(id, id, 1000, 900, AMOUNT_BLIND_FULLY)
* This will seem like an autoflash to the plugin, it will not be blocked by selfflash cvar!
* The screenfade will act like this: 90 seconds the screen will be total white and after that in the las 10 seconds it will fade out,
*/
native FRC_flash_player(flasher 0flasheddurationholdtimeAmnt:ammount)

/*
* This we use to check whether the plugin is on.
* -1 - plugin does not exist!
*  0 - plugin exists but it is turned off!
*  1 - plugin is turned on!
*/
stock is_FRC_on()
{
    if (!
cvar_exists("frc_enable"))
        return -
1
    
    
return get_cvar_num("frc_enable")

Constants:
PHP Code:

enum Amnt
{
    
AMOUNT_BLIND_PARTIALLY     200,
    
AMOUNT_BLIND_FULLY         255
}

enum
{
    
FRC_CONTINUE                0,
    
FRC_MAKE_PARTIALLY          200,
    
FRC_MAKE_FULLY              255,
    
FRC_BLOCK                   300
}

enum Punish
{
    
PUNISH_ATTACK 0,
    
PUNISH_KILL,
    
PUNISH_FLASH

Notes:
If you have problems understanding what this does, or want to do a FRC extension PM me or post here!

FRC Extensions:
FRC FOV Bugfix
FRC Glass Flashbang
FRC Water Flashbang
Attached Files
File Type: inc frc.inc (7.9 KB, 320 views)
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.

Last edited by ot_207; 10-12-2009 at 20:18.
ot_207 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 09-10-2009 , 09:47   Re: [INC] FRC
Reply With Quote #2

Is not "amount" with one 'm' ?
__________________
Arkshine is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-10-2009 , 09:48   Re: [INC] FRC
Reply With Quote #3

Quote:
Originally Posted by Arkshine View Post
Is not "amount" with one 'm' ?
Yeah, typo.
I'm just too lazy to change it now .
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 09-10-2009 , 10:16   Re: [INC] FRC
Reply With Quote #4

;O nice. Another good job
It's a bit hmm, don't know, i think it would be better to make the API separately.
__________________
Still...lovin' . Connor noob! Hello

Last edited by Alka; 09-10-2009 at 10:20.
Alka is offline
SnoW
Veteran Member
Join Date: Oct 2008
Location: Finland WisdomNuggets: 8
Old 09-10-2009 , 10:26   Re: [INC] FRC
Reply With Quote #5

Otty!

Just two cents about the thread name. The inc is referring wrong, since those are multiforwards from other plugin. Also you could use the real name instead of FRC, so people can understand from the title what this is.
SnoW is offline
Send a message via MSN to SnoW
Old 09-10-2009, 10:42
ot_207
This message has been deleted by ot_207. Reason: Repost
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 09-13-2009 , 09:58   Re: [INC] Flashbang Remote Control API [Flash events]
Reply With Quote #6

Quote:
Originally Posted by Alka View Post
;O nice. Another good job
It's a bit hmm, don't know, i think it would be better to make the API separately.
True, but I would like to leave it as it is.
If people would like to create some extensions they are welcomed!

Quote:
Originally Posted by SnoW View Post
Otty!

Just two cents about the thread name. The inc is referring wrong, since those are multiforwards from other plugin. Also you could use the real name instead of FRC, so people can understand from the title what this is.
Will rename it!

Added new functions!
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
Doc-Holiday
AlliedModders Donor
Join Date: Jul 2007
Old 02-12-2012 , 15:50   Re: [INC] Flashbang Remote Control API [Flash events]
Reply With Quote #7

Old thread i know but was linked here... some small typos in the descriptions?

PHP Code:
/* 
* This will set the duration of the flash [Use this in fw_FRC_preflash forward!] 
* Return is in 0.1 seconds! 
* Will return -1 on invalid call! 
*/ 
native get_FRC_duration(flashed


/* 
* This will set the hold time of the flash [Use this in fw_FRC_preflash forward!] 
* Return is in 0.1 seconds! 
* Will return -1 on invalid call! 
*/ 
native get_FRC_holdtime(flashed
Doc-Holiday is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 09:14.


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