Raised This Month: $32 Target: $400
 8% 

Friendly fire cvar changer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Trafalete
Senior Member
Join Date: Sep 2008
Location: Bucuresti ( Printre nori
Old 11-29-2012 , 03:22   Friendly fire cvar changer
Reply With Quote #1

Hi everyone!
I would like to request help with a certain plugin my server needs:

we need a plugin that turns FF on 15seconds after freezetime eneded, and off when round ends

I don't think it should be too difficult
__________________


Trafalete is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 11-29-2012 , 05:57   Re: Friendly fire cvar changer
Reply With Quote #2

Purpose?
Blizzard_87 is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-29-2012 , 06:27   Re: Friendly fire cvar changer
Reply With Quote #3

Try this:
PHP Code:
#include <amxmodx>

new g_pFF

public plugin_init()
{
    
register_logevent("RoundStart"2"1=Round_Start")
    
register_logevent("RoundEnd"2"1=Round_End")
    
    
g_pFF get_cvar_pointer("mp_friendlyfire")
}
    
public 
RoundStart()
    
set_task(15.0"Turn")

public 
RoundEnd()
    
Turn()
    
public 
Turn()
    return 
set_pcvar_num(g_pFF, !get_pcvar_num(g_pFF) ) 
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 11-29-2012 at 12:29.
pokemonmaster is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 11-29-2012 , 08:03   Re: Friendly fire cvar changer
Reply With Quote #4

pokemonmaster also you can do

Code:
return set_pcvar_num(g_pFF, !get_pcvar_num(g_pFF) )
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-29-2012 , 09:33   Re: Friendly fire cvar changer
Reply With Quote #5

Quote:
Originally Posted by lucas_7_94 View Post
pokemonmaster also you can do

Code:
return set_pcvar_num(g_pFF, !get_pcvar_num(g_pFF) )
I remember that I tested once how the ! operator works... I have put !0 it returned 0, also !1 returned 0
But I really don't remember most things I tested
But thank you I will test again.
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.

Last edited by pokemonmaster; 11-29-2012 at 09:34.
pokemonmaster is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-29-2012 , 09:36   Re: Friendly fire cvar changer
Reply With Quote #6

!0 == 1
!1 == 0
!2 == 0
!-1 == 0
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
pokemonmaster
princess milk
Join Date: Nov 2010
Location: Somewhere in this world
Old 11-29-2012 , 12:29   Re: Friendly fire cvar changer
Reply With Quote #7

Quote:
Originally Posted by YamiKaitou View Post
!0 == 1
!1 == 0
!2 == 0
!-1 == 0
OK, thank you.
Updated code above
__________________
اَشْهَدُ اَنْ لَّآ اِلٰهَ اِلَّا اللہُ وَحْدَه لَا شَرِيْكَ لَه وَ اَشْهَدُ اَنَّ مُحَمَّدًا عَبْدُه وَرَسُوْلُه
No longer active in AMXX. Sorry.
pokemonmaster is offline
Trafalete
Senior Member
Join Date: Sep 2008
Location: Bucuresti ( Printre nori
Old 11-30-2012 , 09:53   Re: Friendly fire cvar changer
Reply With Quote #8

testing right now
will return with feedback
__________________


Trafalete is offline
Trafalete
Senior Member
Join Date: Sep 2008
Location: Bucuresti ( Printre nori
Old 11-30-2012 , 09:58   Re: Friendly fire cvar changer
Reply With Quote #9

well it works perfectly
thank you kindly
__________________


Trafalete 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 15:51.


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