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

A problem with "server_cmd" when use Cvar


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jess98
Junior Member
Join Date: Apr 2018
Old 11-15-2018 , 05:34   A problem with "server_cmd" when use Cvar
Reply With Quote #1

Hi. I have been trying to make a plugin that checks player count, if there are low players than 10 it goes to vote maps automatic. I link up the maps to cvar in the below as you see but it doesn't vote maps. What's wrong? Relevant codes about my problem:

Code:
gFirst_Map, gSecond_Map, gThirth_Map, gFourth_Map

---

gFirst_Map = register_cvar("first_voting_map", "fy_snow")
gSecond_Map = register_cvar("second_voting_map", "fy_pool_day")
gThirth_Map = register_cvar("thirth_voting_map", "fy_iceworld")
gFourth_Map = register_cvar("fourth_voting_map", "fy_iceworld16")

---

server_cmd("amx_votemap %s %s %s %s", gFirst_Map, gSecond_Map, gThirth_Map, gFourth_Map)
Jess98 is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 11-15-2018 , 06:11   Re: A problem with "server_cmd" when use Cvar
Reply With Quote #2

Those are cvar pointers you are trying to print. What you actually want is get_pcvar_string.
__________________
klippy is offline
Jess98
Junior Member
Join Date: Apr 2018
Old 11-15-2018 , 06:38   Re: A problem with "server_cmd" when use Cvar
Reply With Quote #3

Quote:
Originally Posted by KliPPy View Post
Those are cvar pointers you are trying to print. What you actually want is get_pcvar_string.
Oh, thanks. Actually at first, it gave me error while compiling when I tried to write it like "(get_pcvar_string(Cvar_Name)" but the right one is "get_pcvar_string(Cvar_Name)", got it.

Last edited by Jess98; 11-15-2018 at 07:53. Reason: Fixed the problem
Jess98 is offline
Reply


Thread Tools
Display Modes

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 14:52.


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