AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   [REQUEST] Friendlyfire checker (https://forums.alliedmods.net/showthread.php?t=301874)

wlmraziel 10-07-2017 20:12

[REQUEST] Friendlyfire checker
 
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.

WhiteFang1319 10-08-2017 06:29

Re: [REQUEST] Friendlyfire checker
 
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");



TheSpaniard 10-08-2017 07:04

Re: [REQUEST] Friendlyfire checker
 
Shit whitefang beat it to me :mrgreen:

wlmraziel 10-08-2017 17:56

Re: [REQUEST] Friendlyfire checker
 
Quote:

Originally Posted by WhiteFang1319 (Post 2553168)
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.

fysiks 10-08-2017 18:05

Re: [REQUEST] Friendlyfire checker
 
You should use set_cvar_num() or set_pcvar_num() instead of server_cmd().

WhiteFang1319 10-09-2017 04:53

Re: [REQUEST] Friendlyfire checker
 
Quote:

Originally Posted by fysiks (Post 2553378)
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)



Ayman Khaled 10-09-2017 07:59

Re: [REQUEST] Friendlyfire checker
 
:?:
PHP Code:

register_cvar("mp_friendlyfire""mp_friendlyfire"


WhiteFang1319 10-09-2017 09:21

Re: [REQUEST] Friendlyfire checker
 
Quote:

Originally Posted by Ayman Khaled (Post 2553440)
:?:
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

Ayman Khaled 10-09-2017 10:57

Re: [REQUEST] Friendlyfire checker
 
something like this.
PHP Code:

new gFriendlyfire
public plugin_init()
{
    
gFriendlyfire get_cvar_pointer("mp_friendlyfire")
}

public 
new_round()
{
    
set_pcvar_num(gFriendlyfire0)



WhiteFang1319 10-09-2017 11:02

Re: [REQUEST] Friendlyfire checker
 
Quote:

Originally Posted by Ayman Khaled (Post 2553470)
something like this.
PHP Code:

new gFriendlyfire
public plugin_init()
{
    
gFriendlyfire get_cvar_pointer("mp_friendlyfire")
}

public 
new_round()
{
    
set_pcvar_num(gFriendlyfire0)



Thanks :)


All times are GMT -4. The time now is 09:59.

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