Фон при загрузке карты.

Olewka

Участник
Сообщения
1
Реакции
0
На многих серверах видел фоновую картинку при подключению к серверу. Они просто автоматически закачивают в папку maps файл карта.jpg. Помогите сделать автоматическую загрузку такой штуки на сервер.
 

Yura7181

Участник
Сообщения
678
Реакции
594
map_content_downloader.sp

PHP:
#include <sourcemod>
#include <sdktools>
 
public Plugin:myinfo =
{
		name            = "Radar and map screen downloader",
		author          = "Joshua 'Woopers' Stinkson",
		description     = "Adds the radar and map screen files to the downloads table",
		version         = "1.0",
		url             = "http://theonion.com/"
}

public OnMapStart()
{
	decl String:mapName[128];
	decl String:loadingScreen[128];
	decl String:radarTexture[128];
	decl String:radarConfig[128];
   
	GetCurrentMap(mapName, sizeof(mapName));
   
	Format(loadingScreen, sizeof(loadingScreen), "maps/%s.jpg", mapName);
	Format(radarTexture, sizeof(radarTexture), "resource/overviews/%s_radar.dds", mapName);
	Format(radarConfig, sizeof(radarConfig), "resource/overviews/%s.txt", mapName);
   
	if(FileExists(loadingScreen))
	{
		AddFileToDownloadsTable(loadingScreen);
		PrintToServer("Loading screen found: %s",loadingScreen);
	}
	if(FileExists(radarTexture))
	{
		AddFileToDownloadsTable(radarTexture);
		PrintToServer("Radar found: %s",radarTexture);
	}
	if(FileExists(radarConfig))
	{
		AddFileToDownloadsTable(radarConfig);
		PrintToServer("Radar definition file found: %s",radarConfig);
	}
}

Источник:

https://rulesofp.wordpress.com/
 
Сверху Снизу