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

[REQUEST] Friendlyfire checker


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wlmraziel
Member
Join Date: Mar 2017
Old 10-07-2017 , 20:12   [REQUEST] Friendlyfire checker
Reply With Quote #1

Hi, there are a plugin for check if in the server the mp_friendlyfire is on? In this case the plugin can disable the mp_friendlyfire.
Solved.

Last edited by wlmraziel; 10-08-2017 at 17:57. Reason: Solved
wlmraziel is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 10-08-2017 , 06:29   Re: [REQUEST] Friendlyfire checker
Reply With Quote #2

Why would you need it? Just set it to 0 in server.cfg and amxx.cfg. Don't give change cvar access to your admins if they'll do it. You can use this, it will set friendlyfire 0 on every round start.
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Anti-FriendlyFire"
#define VERSION "1.0"
#define AUTHOR "WhiteFang"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("new_round"2"1=Round_Start")
    
}
public 
new_round()
{
        
//Setting Friendlyfire 0 on new round
    
server_cmd("mp_friendlyfire 0");


Last edited by WhiteFang1319; 10-08-2017 at 06:31.
WhiteFang1319 is offline
TheSpaniard
Senior Member
Join Date: Jul 2017
Location: Hell
Old 10-08-2017 , 07:04   Re: [REQUEST] Friendlyfire checker
Reply With Quote #3

Shit whitefang beat it to me
__________________
And I Am Back.
TheSpaniard is offline
wlmraziel
Member
Join Date: Mar 2017
Old 10-08-2017 , 17:56   Re: [REQUEST] Friendlyfire checker
Reply With Quote #4

Quote:
Originally Posted by WhiteFang1319 View Post
Why would you need it? Just set it to 0 in server.cfg and amxx.cfg. Don't give change cvar access to your admins if they'll do it. You can use this, it will set friendlyfire 0 on every round start.
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Anti-FriendlyFire"
#define VERSION "1.0"
#define AUTHOR "WhiteFang"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("new_round"2"1=Round_Start")
    
}
public 
new_round()
{
        
//Setting Friendlyfire 0 on new round
    
server_cmd("mp_friendlyfire 0");

Thx, cause there are admins who enable mods but they don't turn off the ff.
wlmraziel is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 10-08-2017 , 18:05   Re: [REQUEST] Friendlyfire checker
Reply With Quote #5

You should use set_cvar_num() or set_pcvar_num() instead of server_cmd().
__________________
fysiks is online now
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 10-09-2017 , 04:53   Re: [REQUEST] Friendlyfire checker
Reply With Quote #6

Quote:
Originally Posted by fysiks View Post
You should use set_cvar_num() or set_pcvar_num() instead of server_cmd().
Is this fine?
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Anti-FriendlyFire"
#define VERSION "1.1"
#define AUTHOR "WhiteFang"

//#define 

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_logevent("new_round"2"1=Round_Start")
    
register_cvar("mp_friendlyfire""mp_friendlyfire")
    
    
// Add your code here...
}
public 
new_round()
{
    
//Setting Friendlyfire 0 on new round
    
set_cvar_num("mp_friendlyfire"0)

WhiteFang1319 is offline
Ayman Khaled
Senior Member
Join Date: Mar 2017
Location: Palestine
Old 10-09-2017 , 07:59   Re: [REQUEST] Friendlyfire checker
Reply With Quote #7


PHP Code:
register_cvar("mp_friendlyfire""mp_friendlyfire"
__________________
Ayman Khaled is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 10-09-2017 , 09:21   Re: [REQUEST] Friendlyfire checker
Reply With Quote #8

Quote:
Originally Posted by Ayman Khaled View Post

PHP Code:
register_cvar("mp_friendlyfire""mp_friendlyfire"
I actually didn't understood how to use set_cvar_num(). It wasn't accepting so I tried that on sv and it was working. Do tell any mistake if I have done
WhiteFang1319 is offline
Ayman Khaled
Senior Member
Join Date: Mar 2017
Location: Palestine
Old 10-09-2017 , 10:57   Re: [REQUEST] Friendlyfire checker
Reply With Quote #9

something like this.
PHP Code:
new gFriendlyfire
public plugin_init()
{
    
gFriendlyfire get_cvar_pointer("mp_friendlyfire")
}

public 
new_round()
{
    
set_pcvar_num(gFriendlyfire0)

__________________

Last edited by Ayman Khaled; 10-09-2017 at 10:58.
Ayman Khaled is offline
WhiteFang1319
Senior Member
Join Date: Jan 2017
Old 10-09-2017 , 11:02   Re: [REQUEST] Friendlyfire checker
Reply With Quote #10

Quote:
Originally Posted by Ayman Khaled View Post
something like this.
PHP Code:
new gFriendlyfire
public plugin_init()
{
    
gFriendlyfire get_cvar_pointer("mp_friendlyfire")
}

public 
new_round()
{
    
set_pcvar_num(gFriendlyfire0)

Thanks
WhiteFang1319 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 00:46.


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