AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help with nextmap scripting! (https://forums.alliedmods.net/showthread.php?t=75264)

VIDEN 08-02-2008 06:51

Help with nextmap scripting!
 
When you have mapchooser and nextmap (the standrard plugins) on you server. When you write nextmap its says de_dust2 maybe, and afther 20 minutes the mapvote comes and pepole vote on another map. I want that the nextmap should say A Vote will occur when time limit has ended. Afther the vote is should say Next map: de_cbble.

This is what i have: (First time i try to script)
PHP Code:

#if defined DISPLAY_MSG
public sayNextMap()
{
 new 
name[32]
 
 
getNextMapName(name31)
 
 if (
get_cvar_float("mp_timelimit"))
 {
  new 
timeleft get_timeleft()
 
  if (
timeleft 3)
  {
          
client_print(0print_chat"%L %s"LANG_PLAYER"NEXT_MAP_MSG")
  } else {
          
client_print(0print_chat"%L %s"LANG_PLAYER"NEXT_MAP"name)
  }
 }
}
#endif 

Sry for bad english.

Lee 08-04-2008 20:56

Re: Help with nextmap scripting!
 
That was the first problem I tried to tackle two years ago, and we both screwed it up pretty similarly. Note that get_timeleft() returns seconds and not minutes.

Remove/comment sayNextMap() from nextmap.sma and move the relevant register_clcmd() call from plugin_init() in nextmap.sma to the same function in mapchooser.sma. Then add this version of sayNextMap() to mapchooser.sma.

Code:
public sayNextMap() {     if(g_selected)     {         new name[32]         get_cvar_string("amx_nextmap", name, 31);         client_print(0, print_chat, "%L %s", LANG_PLAYER, "NEXT_MAP", name)     }     else     {         client_print(0, print_chat, "%L", LANG_PLAYER, "NEXT_MAP_MSG")     } }

I assume you've added NEXT_MAP_MSG to the language files.

Brad 08-04-2008 23:45

Re: Help with nextmap scripting!
 
One of the things my unreleased map voting plugin, Galileo, does is set amx_nextmap to "[not yet voted on]" before a vote, and then "[voting in progress]" during a vote, and finally the map name after the map has been determined.

Just throwing it out there in case the concept interests you and because I'm whoring my plugin out before it's released.


All times are GMT -4. The time now is 05:34.

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