Raised This Month: $106 Target: $400
 26% 

[AMXX] CSGO Round End Events


Post New Thread Reply   
 
Thread Tools Display Modes
EFFx
Veteran Member
Join Date: Feb 2016
Location: SP, Brazil
Old 02-07-2017 , 15:19   Re: Round End Events
Reply With Quote #11

Quote:
Originally Posted by Craxor View Post
looks nice, gj
I appreciate you.
__________________

Last edited by EFFx; 02-07-2017 at 21:00.
EFFx is offline
Send a message via Skype™ to EFFx
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Upplands Väsby, Sweden
Old 02-13-2017 , 16:02   Re: Round End Events
Reply With Quote #12

Code:
#define IsUserValidConnected(%1)    (FIRST_PLAYER <= %1 <= g_MaxPlayers)
This is extremely misleading and possibly a cause for error, why are you not using is_user_connected()?

Code:
    if(g_LastAnnounce)     {         if(is_user_alive(g_LastAnnounce))         {             if(cs_get_user_team(g_LastAnnounce) == CS_TEAM_T)             {                 checkChance(ev_Clutch, false, g_LastAnnounce)             }         }     }
LastMemberAliveClutch has really no checks if the player is actually the last player alive or if that player has killed anyone. It only checks if there is a player that is announced, if that player is announced and if that player is on the winning team

Code:
new const AllWeapons[][] = {     "weapon_p228",     "weapon_elite",     "weapon_fiveseven",     "weapon_ump45",     "weapon_galil",     "weapon_famas",     "weapon_usp",     "weapon_glock18",     "weapon_awp",     "weapon_mp5navy",     "weapon_m249",     "weapon_m3",     "weapon_m4a1",     "weapon_tmp",     "weapon_deagle",     "weapon_ak47" }
You seem to be missing a lot of weapons.

At this point I got tired because there are far bigger issues and I will leave you with this:
This is far from a public release. I think what happened is that you started small and built it so big that you don't understand it anymore. What you need to do is rewrite it. I know this sucks to hear but it really is the only option. There's so much hardcoding which makes it this massive 900 lines plugin which could really be slimmed down and more easily understood and managed.

You need to utilize multi-dimensional arrays and/or enumeration a whole lot more. This enables you to remove most of your if/else statements. For example, all of your strings. If you include this in a multi-dimensional array you only need one formatex() and you could use placeholders like %NAME% or just % to later add that to all messages that needs it. This also enables you to enable/disable each event easier using a cvar or config file.

Your checkChance() system, as far as I can understand, uses the first event and then tries to replace that with a certain chance of success each time. This means that you will probably see repeated events. If the chance is small, it will often be the first event and if the chance is big, it will be the last. It would be better to select from a pool with equal chance for all options. You could do this by saving data for each event in dynamic arrays which you then point to by a dynamic array. At the end, select a random number from 0 to *number of events that round*. Get all the data that relates to that event and print it all out. Clear all the arrays.
__________________
Black Rose is offline
Send a message via Skype™ to Black Rose
EFFx
Veteran Member
Join Date: Feb 2016
Location: SP, Brazil
Old 02-14-2017 , 19:54   Re: Round End Events
Reply With Quote #13

I understand my code, why will I post this here if I don't understand? Knowledge with your plugin is the most important thing for you improve your plugin.

About these things you said, i'll do it when I get time because I haven't right now. I can easily do all things that you/other person tell, just tell me what I should do instead of re-writing it.

I'm searching more events for release with all optimizations later, I want not post thing per thing, so it will take a little time...
__________________

Last edited by EFFx; 02-14-2017 at 19:56.
EFFx is offline
Send a message via Skype™ to EFFx
EFFx
Veteran Member
Join Date: Feb 2016
Location: SP, Brazil
Old 03-04-2017 , 21:39   Re: Round End Events
Reply With Quote #14

Released the version 1.1:

ºAdded new events:
. Protected the bomb planted from enemies.
. Given damage to many enemies.
. Did so many damage with HE Grenade.
. Won the round with less than 1 second.
. Killed an/so many player/s with HE grenade.
. Killed an/so many player/s in the air.
. Killed an/so many enemy/ies with a grenade after dying.
. Jumped so many times in that round.
. Killed an/so many enemy/ies with low HP.
. Survived the most time.
. Defused the bomb with much terrorists alives.

ºCode edited
. Added more values to some events, like:
* Before, we had only 'an enemy', or '%d enemies' in different events, now, I've added '%d enemy/ies' message in these events. Then all these now have a capacibility to catch one or more than one kills. Like KnifeKills constant-string that had before.
. Added more weapons than before, I've missed so many of them.
. Added gLastDroppedWeapon, gLastBroughtWeapon and g_iItemNum for check if the weapon that the player has dropped/bought is not the same that he already has dropped/bought before for the ev_DonatedWeapons and ev_ItemsBought event.
. Transfered the g_LastAnnounce from event_TWin() and event_CTWin to Round_End() function.
. Removed the boolean isForCheckChance at checkChance() stock. That boolean wasn't making sense.
. Added a new stock: GetPlayers(), this stock I've made because I had so much get_players() in the plugin, I know it doesn't matter but It's more easier to manipulate for me and for others peoples I hope. And that stock made the plugin lose so much lines, what's good as well.
. Edited the ev_UserKills, now you can see a percent instead of User's kills.
. Added arAloneKills to PlayerData because the ev_Clutch event.
. Removed the Ham_Killed. Using DeathMsg instead.
. Reseting the arConsecutiveRounds after sv_restart and Game Commecing, then removed the -1 at showEvents().
. Transfered the get_user_weapon(iVictim) & CSW_KNIFE) to Ham_TakeDamage.
. Removed IsUserValidConnected, using is_user_connected() instead.


And some optimizations on the code.
__________________

Last edited by EFFx; 03-05-2017 at 14:13.
EFFx is offline
Send a message via Skype™ to EFFx
Relaxing
Veteran Member
Join Date: Jun 2016
Location: Catlands
Old 03-05-2017 , 06:45   Re: Round End Events
Reply With Quote #15

Nailed it, aced it, can't be stopped.
__________________
Have A Relaxing Day | Wiki
aim_relaxing
Relaxing is offline
yas17sin
Veteran Member
Join Date: Oct 2016
Location: Morocco/Sale
Old 03-05-2017 , 12:43   Re: Round End Events
Reply With Quote #16

realy Gj. i like it.
__________________
FINISHED WORKING ON : Attack On Titan Mod (100% Done).

FB Acc : FaceBook Account.

pic: http://prntscr.com/fszkke not good quality
yas17sin is offline
Send a message via ICQ to yas17sin
EFFx
Veteran Member
Join Date: Feb 2016
Location: SP, Brazil
Old 03-05-2017 , 14:03   Re: Round End Events
Reply With Quote #17

I appreciate you guys.
__________________
EFFx is offline
Send a message via Skype™ to EFFx
EFFx
Veteran Member
Join Date: Feb 2016
Location: SP, Brazil
Old 03-07-2017 , 03:24   Re: Round End Events
Reply With Quote #18

Released the version 1.2:

ºAdded new events:

. So many terrorists tried to plant the bomb.
. So many cts tried to defuse the bomb.
. Successfuly stoped so many/the bomb defuser/s.
. Successfuly stoped so many/the bomb planter/s.

ºCode edited:
. Changed the position of "y" : "ies" to "ies" : "y" in some events.
. Fixed the jump count format and added [33] size.
. Replaced boolPlayerData[iKiller][arPlayerKills]+PlayerData[iKiller][arPlayerBombKills]+PlayerData[iKiller][arAloneKills] >= OppositeTeamNumber[/i] with PlayerData[iKiller][arPlayerKills] >= OppositeTeamNumber only.
. Fixed the faster kill time.
. Changed MAX_CHANCE to 6.
. Added log_amx().
. Changed eLastEvent == ev_Ace to eLastEvent == event.
. Added important events, now these event's chance is divided with 2.

They're:

Ace, Clutch, Player's accuracy, Killed players with one HE, Killed after dying, Killed someone in the air, Killed someone with knife and Killed someone with low HP.

. Fixed a bug with LowHeathKills's event parameter's. I've forgot the second parameter.
. Removed the isAce boolean.
. Removed the NumToStr stock then fixed the heap low bug.
. Removed the is_user_connected check at deathMsg.
. Fixed the wrong value with iMultiplication, it was showing 160 instead of the real value.
. Added a check for see if the iKiller is a Terrorist at ev_ProtectedTheBomb event.
. Fixed the Assist and AttacksBeforeDying events.
. Removed the GetPlayers() stock. Reason?

With the stock:

L 03/06/2017 - 206:45: [RoundEndEvents.amxx] Ace! [POD]Polymorph (9 killed the entire enemy team.
L 03/06/2017 - 208:03: [RoundEndEvents.amxx] [P0D]Sharon_Stone (95) killed an enemy with knife
L 03/06/2017 - 209:53: [RoundEndEvents.amxx] EFFx brought a knife to a gunfight.
L 03/06/2017 - 20:40:52: [RoundEndEvents.amxx] Ace! EFFx killed the entire enemy team.
L 03/06/2017 - 20:42:42: [RoundEndEvents.amxx] EFFx killed an enemy with knife
L 03/06/2017 - 20:44:49: [RoundEndEvents.amxx] EFFx brought a knife to a gunfight.
L 03/06/2017 - 20:46:25: [RoundEndEvents.amxx] EFFx killed an enemy with knife
L 03/06/2017 - 20:57:05: [RoundEndEvents.amxx] EFFx has bought 0 items.
L 03/06/2017 - 22:48:14: [RoundEndEvents.amxx] Ace! [P*D]Will_Smith (9 killed the entire enemy team.
L 03/06/2017 - 22:49:27: [RoundEndEvents.amxx] EFFx brought a knife to a gunfight.
L 03/06/2017 - 22:51:05: [RoundEndEvents.amxx] Ace! EFFx killed the entire enemy team.
L 03/06/2017 - 22:41:07: [RoundEndEvents.amxx] Ace! [P*D]Will_Smith (9 killed the entire enemy team.
L 03/06/2017 - 22:41:52: [RoundEndEvents.amxx] EFFx brought a knife to a gunfight.
L 03/06/2017 - 22:42:21: [RoundEndEvents.amxx] Ace! EFFx killed the entire enemy team.

These events was much normal, always appearing in the hud, almost is not Ace but it shows Ace and it shows wrong values and player's name.

Without the stock:

L 03/07/2017 - 019:20: [RoundEndEvents.amxx] [POD]Sharon_Stone (96) lasted 2 consecutive rounds without dying.
L 03/07/2017 - 01:40:49: [RoundEndEvents.amxx] EFFx caused the first death after 17 seconds of round starts.
L 03/07/2017 - 01:42:05: [RoundEndEvents.amxx] Counter-Terrorists won without taking any casualties.
L 03/07/2017 - 01:43:44: [RoundEndEvents.amxx] EFFx caused the first death after 18 seconds of round starts.
L 03/07/2017 - 01:44:11: [RoundEndEvents.amxx] [P*D]Rodney_Dangerfield (100) lasted 3 consecutive rounds without dying.
L 03/07/2017 - 01:45:23: [RoundEndEvents.amxx] EFFx lasted 2 consecutive rounds without dying.
L 03/07/2017 - 01:463: [RoundEndEvents.amxx] [POD]Sharon_Stone (96) killed 40% of the enemy team.
L 03/07/2017 - 01:48:15: [RoundEndEvents.amxx] [POD]Sharon_Stone (96) caused the first death after 20 seconds of round starts.
L 03/07/2017 - 01:492: [RoundEndEvents.amxx] As the last member alive, EFFx killed 2 enemies and won.
L 03/07/2017 - 01:51:19: [RoundEndEvents.amxx] [POD]Sharon_Stone (96) jumped 6 times during the round.
L 03/07/2017 - 01:52:57: [RoundEndEvents.amxx] 115 shoots were fired that round.
L 03/07/2017 - 01:54:46: [RoundEndEvents.amxx] EFFx killed 2 enemies.
L 03/07/2017 - 01:55:49: [RoundEndEvents.amxx] [P*D]killaruna (99) killed 2 enemies with under 25 health.
L 03/07/2017 - 01:59:00: [RoundEndEvents.amxx] [POD]Sharon_Stone (96) killed an enemy with his last bullet.
L 03/07/2017 - 02:033: [RoundEndEvents.amxx] [P0D]Jet_Li (97) received 2 different attacks before dying.
L 03/07/2017 - 02:04:29: [RoundEndEvents.amxx] [P*D]Jim_Carrey (96) defended the planted bomb from 3 enemies.
L 03/07/2017 - 02:05:19: [RoundEndEvents.amxx] 192 shoots were fired that round.
L 03/07/2017 - 02:06:53: [RoundEndEvents.amxx] [P*D]Jim_Carrey (96) received 2 different attacks before dying.
L 03/07/2017 - 02:270: [RoundEndEvents.amxx] Terrorists had the best accuracy with 60%
L 03/07/2017 - 02:28:12: [RoundEndEvents.amxx] [P0D]Mickey_Rourke (99)'s accuracy was 38 while his team was 29%
L 03/07/2017 - 02:29:03: [RoundEndEvents.amxx] [P0D]Mickey_Rourke (99) survived the most time: 130 seconds.
L 03/07/2017 - 020:58: [RoundEndEvents.amxx] CTs had the best accuracy with 24%
L 03/07/2017 - 021:53: [RoundEndEvents.amxx] Terrorists won without taking any casualties.
L 03/07/2017 - 0223: [RoundEndEvents.amxx] [P0D]Sharon_Stone (96) brought a knife to a gunfight.
L 03/07/2017 - 024:21: [RoundEndEvents.amxx] [P*D]Kim_Basinger (9 given damage to 2 different enemies before dying.

These events has appeared after I removed the stock.

So much better. Without that stock, more events appear in the hud, repeating obviously but with correct values and player's name, I don't know why.
__________________

Last edited by EFFx; 03-07-2017 at 03:43.
EFFx is offline
Send a message via Skype™ to EFFx
gRfd
Member
Join Date: Jan 2009
Old 03-07-2017 , 10:12   Re: Round End Events
Reply With Quote #19

Errors
Attached Thumbnails
Click image for larger version

Name:	Untitled.png
Views:	35
Size:	41.0 KB
ID:	161364  
gRfd is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Location: Portugal
Old 03-07-2017 , 18:44   Re: Round End Events
Reply With Quote #20

Well EFFx, i don't actually understand what's the problem you are having, explain it better please.
I don't have much time but i had a quick look on the plugin, there is something you should change:

PHP Code:
formatex
            
(
                
formatMsg,charsmax(formatMsg),
                
EventMessages[LastBullet],
                
PlayerData[g_UserEventKiller][PlayerName],
                
bMoreThanOne szValue "an",
                
bMoreThanOne "ies" "y"
            

You should use if(bMoreThanOne){...} and then use else{...}.
It may not look very beautiful but it's unnecessary to check 2 times the value of bMoreThanOne.
__________________
Jhob94 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 21:25.


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