Raised This Month: $51 Target: $400
 12% 

[CS 1.6] Gameplay: Fireworks on End Round 1.3


Post New Thread Reply   
 
Thread Tools Display Modes
luciaus18
Senior Member
Join Date: Dec 2014
Old 01-07-2015 , 07:03   Re: [CS 1.6] Gameplay: Fireworks on End Round 1.1
Reply With Quote #21

no, i tryed, this happen only when fireworks is activated
luciaus18 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-07-2015 , 07:10   Re: [CS 1.6] Gameplay: Fireworks on End Round 1.1
Reply With Quote #22

Then, I'm sorry. I'm not sure what is the problem.
zmd94 is offline
luciaus18
Senior Member
Join Date: Dec 2014
Old 01-07-2015 , 16:24   Re: [CS 1.6] Gameplay: Fireworks on End Round 1.1
Reply With Quote #23

my bad !!

Last edited by luciaus18; 01-08-2015 at 10:34.
luciaus18 is offline
Perfect Scrash
Senior Member
Join Date: Aug 2013
Location: Brazil
Old 01-08-2015 , 13:04   Re: [CS 1.6] Gameplay: Fireworks on End Round 1.2
Reply With Quote #24

Plugin Updated !! Made in day 01/08/2015

* Added ZP support
* Fixed Lang Messages
* Added Cvar amx_fireworks_message_enable
__________________
Perfect Scrash is offline
Send a message via Skype™ to Perfect Scrash
matrix123
Veteran Member
Join Date: Feb 2011
Old 01-08-2015 , 14:32   Re: [CS 1.6] Gameplay: Fireworks on End Round 1.2
Reply With Quote #25

translate spanish

"Fuegos del artificiales" not exist

"Fuegos Artificiales" fixed

sorry for my bad english
__________________
matrix123 is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-08-2015 , 18:58   Re: [CS 1.6] Gameplay: Fireworks on End Round 1.2
Reply With Quote #26

Nice, Perfect Scrash.

Welcome again to AM. ;)
zmd94 is offline
Basakot
Junior Member
Join Date: Jan 2015
Location: Resita, Romania
Old 01-13-2015 , 13:52   Re: [CS 1.6] Gameplay: Fireworks on End Round 1.2
Reply With Quote #27

Nice plugin, gonna test it ^^

EDIT: It would be nice to add and a firework sound

Last edited by Basakot; 01-15-2015 at 11:29.
Basakot is offline
Send a message via Skype™ to Basakot
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-02-2015 , 14:10   Re: [CS 1.6] Gameplay: Fireworks on End Round 1.2
Reply With Quote #28

PHP Code:
enum TEAM_T 1TEAM_CT }
enum TEAM_ZOMBIE 1TEAM_HUMAN }
#endif 
Do not reinvent the wheel, since you are using cstrike module use CS_TEAM_* definitions. Also the zp include already define WIN_*, you could work with them.

PHP Code:
for(new id 1id <= get_maxplayers(); id++) 
get_maxplayers should be cached, but at the end you should not loop like this. Use get_players, it give you only valid players and it's faster, though the speed difference is trivial.
You are using wrongly LANG_PLAYER, this should be used when you pass 0 as index. If you are actually using a player index, then use the player index there too.

Do not acces cvar values inside loops, cache them before. Caching means to save the value of a native, it worth when a native will be called more than one time.

PHP Code:
    if(get_pcvar_num(cvar_type) <= 0set_task(AUTO_RELASE_INTERVAL"auto_relase"id+TASK_AUTORELASE
Do not create 32 tasks(or how many players are), create only one task and parse players inside it.
You don't need to loop after all in zp_round_ended, just send the message with index 0(then keep LANG_PLAYER).

Same reasoning can be applied in t_win and ct_win, do not loop at all, send the message with index 0 and create only one task.

In autorelease:
PHP Code:
if(cs_get_user_team(id) == CS_TEAM_T && g_fireworks_team == TEAM_T || cs_get_user_team(id) == CS_TEAM_CT && g_fireworks_team == TEAM_CT
This can be shortened too cs_get_user_team(id) == g_fireworks_team.


fw_PlayerPreThink is not needed, to detect IN_USE sound you can hook pfnEmitSound and check against common/wpn_denyselect.wav sound.

Drop the public keyword in front of make_fireworks and fireworks_effect. public is for things that may be called from outside of the plugin(forwards, tasks, etc).

Checking
PHP Code:
if(!get_pcvar_num(cvar_enable))
        return; 
in make fireworks is reduntant, it's checked before you call the function.

In fireworks_effect static is not needed.

AMXX 1.8.3 already have a function for printing colored messages, so you could check amxx version and decide what to use. Also, your client_printcolor is poor:
  • Do not hardcode strings size, use charsmax().
  • is_user_connected is reduntant.
  • get_user_msgid("SayText") should be cached.
  • Do not reindex an array.

The most obvious mistakes which you could start.
__________________

Last edited by HamletEagle; 09-03-2015 at 04:12.
HamletEagle is offline
Perfect Scrash
Senior Member
Join Date: Aug 2013
Location: Brazil
Old 09-04-2015 , 14:38   Re: [CS 1.6] Gameplay: Fireworks on End Round 1.3
Reply With Quote #29

Plugin Updated 04/09/2015

* Removed Hard Codded
* Removed define ZP_SUPPORT because not needed for works in zombie plague
* Optimed code
* Now is not needed cstrike's module for plugin works
* Removed Unecessary loops
* get_maxplayers is now cached
* etc
__________________
Perfect Scrash is offline
Send a message via Skype™ to Perfect Scrash
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-04-2015 , 16:17   Re: [CS 1.6] Gameplay: Fireworks on End Round 1.3
Reply With Quote #30

1.Instead of a define, AUTO_RELASE_INTERVAL should be a cvar. Maybe people want bigger or lower delay.
2.When printing the message check again if version is < 183. If so use client_printcolor, otherwise use http://www.amxmodx.org/api/amxmodx/client_print_color. So you will have full support for 1.8.3
3.Be consistent, in some places you put { under public x, in some at the same line.
4.Checking !get_pcvar_num(cvar_enable) in auto_relase it is not needed, you will reach there only if cvar_enable is 1.
5.I told you to do not loop like this for(new id = 1; id <= g_maxplayers; id++). Do instead:
PHP Code:
new Players[32], Numid
get_players
(PlayersNum"a")
for(new 
iNumi++)
{
     
id Players[i]

Also, you could use flag "e" in get_players and get players only from the team that sould see the fireworks.
Like:
PHP Code:
switch(g_fireworks_team)
{
    case 
TEAM_T:
    {
        
get_players(PlayersNum"ae""TERRORIST")
    }
    case 
TEAM_CT:
    {
        
get_players(PlayersNum"ae""CT")
    }

6.Remove PreThink and hook EmitSound to detect when IN_USE is used(as I told you before).
PHP Code:
register_forward(FM_EmitSound"pfnEmitSound")
public 
pfnEmitSound(idChannel, const Sound[]) 
{
    if(
equal(Sound"common/wpn_denyselect.wav") && (pev(idpev_button) & IN_USE))
    {
        
//IN_USE was pressed
    
}

7.In make_fireworks, remove the alive, enable and team checks, get_players already do this(see 5).
8.client_printcolor stock should be inside a check for amxx version num, not a big deal, if not used it won't be compiled, but for consistency you should do this.
9.Use charsmax() in vformat.
10.#if AMXX_VERSION_NUM < 183 should not be inside the stock, put it outside the stock, see 8.
__________________
HamletEagle is offline
Reply



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 10:00.


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