Raised This Month: $ Target: $400
 0% 

[REQ]Simple Auto Cvar Changer


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
counter1strike6
Senior Member
Join Date: Sep 2014
Location: morocco
Old 10-21-2014 , 08:27   [REQ]Simple Auto Cvar Changer
Reply With Quote #1

Hi all

i need simple plugin that change cvars automatically please

just like this
-when there are only one player in CT team
auto set cvars to:
zp_human_unlimited_ammo 2
zp_survivor_unlimited_ammo 2

-when there are more then tow player in CT team
auto set cvars to:
zp_human_unlimited_ammo 1
zp_survivor_unlimited_ammo 1


thanks and sorry for bad english
counter1strike6 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-21-2014 , 10:00   Re: [REQ]Simple Auto Cvar Changer
Reply With Quote #2

amx_cvar change the cvar value immediately. But a delay may appear depending on the plugin that handle this cvars.
__________________
HamletEagle is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-21-2014 , 10:57   Re: [REQ]Simple Auto Cvar Changer
Reply With Quote #3

Quote:
Originally Posted by HamletEagle View Post
amx_cvar change the cvar value immediately. But a delay may appear depending on the plugin that handle this cvars.
Your answer makes no sense to his request.


@counter1strike6, i am at work and i can't do it. Create a task, (not recommended to use lower than 1 second) and check the amount of players. But since this is for ZP, i believe there are another ways to do it that uses less cpu. I havent used zp much time but i remember for example of something like zp_last_human. You should have asked it on zombie sub-forum where experienced people with that mod could help you more easily.
__________________
Jhob94 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 10-21-2014 , 11:10   Re: [REQ]Simple Auto Cvar Changer
Reply With Quote #4

I didn't understood what he wants...
__________________
HamletEagle is offline
Jhob94
AMX Mod X Donor
Join Date: Jul 2012
Old 10-21-2014 , 11:22   Re: [REQ]Simple Auto Cvar Changer
Reply With Quote #5

He wants that on last CT, cvars get changed and when more than 1 CT, cvars go back to normal
__________________
Jhob94 is offline
jiraiacs
Junior Member
Join Date: Mar 2013
Location: Belo Horizonte MG Brazil
Old 10-21-2014 , 12:37   Re: [REQ]Simple Auto Cvar Changer
Reply With Quote #6

cvars_access_system.amxx ; CVars Access System https://forums.alliedmods.net/showthread.php?p=452641
jiraiacs is offline
Chihuahuax
Senior Member
Join Date: Oct 2014
Location: Malaysia
Old 10-21-2014 , 12:45   Re: [REQ]Simple Auto Cvar Changer
Reply With Quote #7

Not sure if he's asking for this:
https://forums.alliedmods.net/showth...unlimited+clip

One player in ct = last human?

One more thing @counter1strike6: juz to make sure* are you asking this for zombie plague or classic mode?

Last edited by Chihuahuax; 10-21-2014 at 12:53. Reason: wrong link :P
Chihuahuax is offline
Send a message via Skype™ to Chihuahuax
Decak
Senior Member
Join Date: Sep 2012
Old 10-21-2014 , 14:46   Re: [REQ]Simple Auto Cvar Changer
Reply With Quote #8

Try this:

Code:
#include <amxmodx>

public plugin_init() {
    register_plugin("Set Cvars", "1.0", "DecaK")
    register_event("HLTV", "enr", "a", "1=0", "2=0")
}

public enr() {
    new Players[32], ct;
    get_players(Players,ct,"e","CT")
    if(ct < 2) {
    server_cmd("amx_cvar zp_human_unlimited_ammo 2")
    server_cmd("amx_cvar zp_survivor_unlimited_ammo 2")
}
    else { 
    server_cmd("amx_cvar zp_human_unlimited_ammo 1")
    server_cmd("amx_cvar zp_survivor_unlimited_ammo 1")
}
    return PLUGIN_HANDLED;
}

Last edited by Decak; 10-21-2014 at 14:46.
Decak is offline
counter1strike6
Senior Member
Join Date: Sep 2014
Location: morocco
Old 10-22-2014 , 18:21   Re: [REQ]Simple Auto Cvar Changer
Reply With Quote #9

@Chihuahuax, yes that what i want but not work for ZP 5.0.7
i want last human or survivor get unlimited clip.
maybe someone make this for ZP 5.0x

@Decak, i have it tested on ZP 5.0.7 and on normal server
but not work perfectly.

only this what happening at the round start
PLAYER : set cvar zp_human unlimited ammo to "1"
PLAYER : set cvar zp_survivor unlimited ammo to "1

nothing when there is only one player in the CT team :/

Last edited by counter1strike6; 10-22-2014 at 18:50.
counter1strike6 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 13:41.


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