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

Trying to show getCurrentMap on the screen


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
bloodmodii
Member
Join Date: Jun 2016
Old 04-02-2020 , 21:44   Trying to show getCurrentMap on the screen
Reply With Quote #1

Hi, Im trying to get to show mapName in the text, but it doesn't want to show up, im very new to all of this and im just trying to modify this plugins : https://forums.alliedmods.net/showthread.php?t=309700






Code:
#include <sourcemod>

public Plugin myinfo = 
{
	name = "Panorama - Timeleft",
	author = "Fastmancz",
	description = "Shows timeleft at the bottom of the screen",
	version = "1.0.1"
};

public void OnPluginStart()
{
	CreateTimer(1.0, Timeleft, _, TIMER_REPEAT);
}

public Action Timeleft(Handle timer)
{
	char sTime[60];
	int iTimeleft;
char mapName[100]; //this is the variable I added
GetCurrentMap(mapName, sizeof(mapName));
	GetMapTimeLeft(iTimeleft);
	if(iTimeleft > 0)
	{
		FormatTime(sTime, sizeof(sTime), "%M:%S", iTimeleft);

		for(int i = 1; i <= MaxClients; i++)
		{
			if(IsClientInGame(i) && !IsFakeClient(i))
			{
				char message[160];
				Format(message, sizeof(message), "surf-ftw.com - Timeleft: %s mapName", sTime); //trying to put it there
				SetHudTextParams(-1.0, 1.00, 1.0, 4, 180, 255, 255, 0, 0.00, 0.00, 0.00);
				ShowHudText(i, -1, message);
			}
		}
	}
	return Plugin_Continue;
}

Last edited by bloodmodii; 04-02-2020 at 22:07.
bloodmodii is offline
Silvers
SourceMod Plugin Approver
Join Date: Aug 2010
Location: SpaceX
Old 04-02-2020 , 22:50   Re: Trying to show getCurrentMap on the screen
Reply With Quote #2

PHP Code:
Format(messagesizeof(message), "surf-ftw.com - Timeleft: %s. Map: %s"sTimemapName); 
__________________
Silvers is offline
bloodmodii
Member
Join Date: Jun 2016
Old 04-02-2020 , 23:10   Re: Trying to show getCurrentMap on the screen
Reply With Quote #3

thanks
bloodmodii 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:25.


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