AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   A problem with "server_cmd" when use Cvar (https://forums.alliedmods.net/showthread.php?t=312071)

Jess98 11-15-2018 05:34

A problem with "server_cmd" when use Cvar
 
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)


klippy 11-15-2018 06:11

Re: A problem with "server_cmd" when use Cvar
 
Those are cvar pointers you are trying to print. What you actually want is get_pcvar_string.

Jess98 11-15-2018 06:38

Re: A problem with "server_cmd" when use Cvar
 
Quote:

Originally Posted by KliPPy (Post 2624121)
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.


All times are GMT -4. The time now is 07:35.

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