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

Plugin Idea


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 05-28-2022 , 05:36   Plugin Idea
Reply With Quote #1

Hi, I'm looking for a plugin that takes away your score if you get killed with a knife.

For example, if my score is 20 kills and 10 deaths and I get killed by another player with a knife, I lose the 20 kills and get a score of 0-10.

Thanks.
JuanitoAlimana is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 05-28-2022 , 06:22   Re: Plugin Idea
Reply With Quote #2

Code:
#include <amxmodx> #include <fun> public plugin_init() {     register_plugin("Knife Set Score to 0", "1.0", "OciXCrom")     register_event("DeathMsg", "OnPlayerKilled", "a", "4=knife") } public OnPlayerKilled() {     set_user_frags(read_data(2), 0) }
__________________

Last edited by OciXCrom; 05-28-2022 at 06:23.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 05-31-2022 , 04:37   Re: Plugin Idea
Reply With Quote #3

Awesome! Can you add a cvar so I can enable/disable this feature in game? Thank you so much.
JuanitoAlimana is offline
Krystek.
Member
Join Date: May 2022
Old 05-31-2022 , 05:42   Re: Plugin Idea
Reply With Quote #4

Code:
#include <amxmodx>
#include <fun>

new k_Enable;

public plugin_init() {
    register_plugin("Knife Set Score to 0", "1.0", "OciXCrom")
    register_event("DeathMsg", "OnPlayerKilled", "a", "4=knife")

    k_Enable = register_cvar("amx_knife_score", "1");
}

public OnPlayerKilled() {
    if(!get_pcvar_num(k_Enable))
        return;

    set_user_frags(read_data(2), 0)
}
Try it and let me know.

Last edited by Krystek.; 05-31-2022 at 05:45.
Krystek. is offline
JuanitoAlimana
Senior Member
Join Date: Aug 2021
Old 06-03-2022 , 04:55   Re: Plugin Idea
Reply With Quote #5

Works flawlessly. Thank you so much!
JuanitoAlimana 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 21:33.


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