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

[WEAPONS] Frags/Deaths Changer


Post New Thread Reply   
 
Thread Tools Display Modes
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 06-02-2014 , 15:12   Re: Frags/Deaths Changer (AIO)
Reply With Quote #21

Quote:
Originally Posted by Flick3rR View Post
IMPORTANT ЕDIT: I think there is an important mistake! Take a look:
PHP Code:
HeadShot read_data(2
--->
PHP Code:
HeadShot read_data(3
I didnt tested the plugin, how no one saw the fail before?
Fixed, btw
__________________
Jhob94 is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-02-2014 , 16:22   Re: Frags/Deaths Changer (AIO)
Reply With Quote #22

Well then you should test your plugin before you release it.
  • Your cvar model is kind of silly, there's no need to have so many. Instead of cvars, you could register admin commands such as fdc_kill <weaponname> <frags>. It's not a big deal, but it definitely looks much nicer. For example, look at this: https://forums.alliedmods.net/showthread.php?p=1117804. With this and a couple of other edits you could also make this plugin support all mods.
  • Your frags won't get updated, DeathMsg is called too late. Hook Ham_Killed pre hook instead. You would notice this if you tested the plugin.

Also, I don't mean to brag but your closing brackets are INCREDIBLY confusing.
__________________
Currently busy working on a very large scale anime database project.

Last edited by Backstabnoob; 06-02-2014 at 16:25.
Backstabnoob is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 06-02-2014 , 16:52   Re: Frags/Deaths Changer (AIO)
Reply With Quote #23

Quote:
Originally Posted by Backstabnoob View Post
Well then you should test your plugin before you release it.
  • Your cvar model is kind of silly, there's no need to have so many. Instead of cvars, you could register admin commands such as fdc_kill <weaponname> <frags>. It's not a big deal, but it definitely looks much nicer. For example, look at this: https://forums.alliedmods.net/showthread.php?p=1117804. With this and a couple of other edits you could also make this plugin support all mods.
  • Your frags won't get updated, DeathMsg is called too late. Hook Ham_Killed pre hook instead. You would notice this if you tested the plugin.

Also, I don't mean to brag but your closing brackets are INCREDIBLY confusing.
I hadnt any test server available when made it. Hum, i dont have many time right now, but i will look into what you said when i can. And i think cvars are just fine, it runs file where you can edit what you want, i think its better then an admin command. I guess it depends by each one taste, i prefer cvars then commands
About deathmsg, i know its called "late", thats why i remove a frag and add the cvar amount. Would it be better to use ham_killed? I dont know wich of them is more efficient.
Close brackets i can fix ^^
It was a stupid old habit that i had. The amount of lines needed to end in 5 or 0
__________________
Jhob94 is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-02-2014 , 16:58   Re: Frags/Deaths Changer (AIO)
Reply With Quote #24

As I said, cvars are no biggie, but admin commands would be better (they work exactly the same way as cvars if you put them into amxx.cfg), because you would be able to make this plugin compatible with more/all mods. Plus it's cleaner.

You removing a frag doesn't matter, it won't get updated until the next kill/death/whatever. If you use pre Ham_Killed hook, you will be able to alter the frags before the ScoreInfo message is sent therefore it'll refresh with the updated data already.
__________________
Currently busy working on a very large scale anime database project.

Last edited by Backstabnoob; 06-02-2014 at 16:59.
Backstabnoob is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 06-02-2014 , 17:04   Re: Frags/Deaths Changer (AIO)
Reply With Quote #25

Quote:
Originally Posted by Backstabnoob View Post
As I said, cvars are no biggie, but admin commands would be better (they work exactly the same way as cvars if you put them into amxx.cfg), because you would be able to make this plugin compatible with more/all mods.
Hum, i will take a look.

Quote:
Originally Posted by Backstabnoob View Post
You removing a frag doesn't matter, it won't get updated until the next kill/death/whatever. If you use pre Ham_Killed hook, you will be able to alter the frags before the ScoreInfo message is sent therefore it'll refresh with the updated data already.
I forgot about that
But is it more efficient? Cuz i can just update the scoreboard if i need.

PHP Code:
stock change_scoreboard(id)
{    
    
message_begin(MSG_ALLget_user_msgid("ScoreInfo"))
    
write_byte(id)
    
write_short(get_user_frags(id))
    
write_short(get_user_deaths(id))
    
write_short(0)
    
write_short(get_user_team(id))
    
message_end()

__________________
Jhob94 is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-02-2014 , 17:05   Re: Frags/Deaths Changer (AIO)
Reply With Quote #26

Just hook Ham_Killed pre.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 06-02-2014 , 17:30   Re: Frags/Deaths Changer (AIO)
Reply With Quote #27

Backstab, why do you think about the method for registering cvars, triecells, etc. I just want to know some experience's opinion on the question, to know to use it or no. For now it's working for me and I want to know if all is correct. Little off-topic, but I think that it'll be good to know. Sorry if this is out of rules.
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 06-17-2014 , 14:39   Re: Frags/Deaths Changer (AIO)
Reply With Quote #28

I haven't much time, but i had modified somethings on the code as backstab suggested. Unfortunetly, i can't keep it for now.
I wont update the plugin for now, maybe in some weeks.
If you want, you can unapprove it.
__________________
Jhob94 is offline
Backstabnoob
Veteran Member
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 06-17-2014 , 16:34   Re: Frags/Deaths Changer (AIO)
Reply With Quote #29

@Flick3rR: The short answer: it's fine, the long answer: It is not incorrect, but it really doesn't make much sense. I would personally never use it because it looks quite confusing, but it's not wrong so I won't point it out, it's up to the author what method he chooses.

@Jhob94: Send me a PM once you have more time to support it. Moving it to unapproved for now.
__________________
Currently busy working on a very large scale anime database project.
Backstabnoob is offline
Hmmytheos
Junior Member
Join Date: Jul 2014
Old 07-22-2014 , 12:46   Re: Frags/Deaths Changer (AIO)
Reply With Quote #30

I am searching for a plugin that can either stop the madness of adding 3 frags per defusal/planting or just count only the real frags of each player and save them or print them to the player/user/admin...

Is there any out there cause i couldnt found yet one and this doesnt work for me...

Any help/info would be appreciated
Hmmytheos 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 11:18.


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