Alman forumunda bulduğum bu eklentiyi deneyip test ettim çalışıyor bildiğiniz gibi Mafia 2 Multiplayer'da harita açılmıyor.
Şimdi kodları veriyorum.
Bu kodları server dosyalarından client'e gelerek yeni .nut formatında dosya açınız ve map.nut olarak kayıt edin.
Sonra vermiş olduğum resim linkini indirip ismini değiştirip map yapıp serverin Files kısmına atın.
Resim: http://i.hizliresim.com/bJ7Wg8.jpg
Map resminin servere eklenmesi için. meta.xml ye client kısmına bu kodu ekleyin.
Bu kadar kolay gelsin
Şimdi kodları veriyorum.
PHP Kod:
// N0B0DY's Ingame Map
local drawScoreboard = false;
local screenSize = getScreenSize( );
local screenSizeHalfX = screenSize[0] * 0.5;
local screenSizeHalfY = screenSize[1] * 0.5;
local fPadding = 5.0, fTopToTitles = 25.0;
local fWidth = 600.0, fHeightDef = ((fPadding * 2) + (fTopToTitles * 3));
local fHeight = fHeightDef;
local fOffsetID = 50.0, fOffsetName = 450.0;
local fPaddingPlayer = 20.0;
local fX = 0.0, fY = 0.0, fOffsetX = 0.0, fOffsetY = 0.0;
local mapScale = 1024 / 3500.0;
local map = guiCreateElement( 13, "map.jpg", screenSize[0] * 0.5 - 3500.0 * 0.5 * mapScale, screenSize[1] * 0.5 - 3033.0 * 0.5 * mapScale, 3500.0 * mapScale, 3033.0 * mapScale );
guiSetVisible(map, false);
local mapPositionScaleX = 3288.0 * mapScale / 11530.0 * 3.27; // 3500
local mapPositionScaleY = 2860.0 * mapScale / 10000.0 * 3.27; // 3033
local mapPositionOffsetX = 3288.0 * 0.0305;
local mapPositionOffsetY = 2860.0 * 0.048;
local boxsize = 4.0;
local boxhalfsize = boxsize * 0.5;
function tabDown()
{
drawScoreboard = true;
showChat( false );
guiSetVisible(map, true);
guiSetAlpha(map, 0.64);
fHeight = fHeightDef;
for( local i = 0; i < MAX_PLAYERS; i++ )
{
if( isPlayerConnected(i) )
fHeight += fPaddingPlayer;
}
}
bindKey( "m", "down", tabDown );
function tabUp()
{
drawScoreboard = false;
showChat( true );
guiSetVisible(map, false);
guiSetAlpha(map, 0);
// Reset the height
fHeight = ((fPadding * 2) + (fTopToTitles * 3));
}
bindKey( "m", "up", tabUp );
function playerConnect( playerid, nickname )
{
if( drawScoreboard )
fHeight += fPaddingPlayer;
}
addEventHandler( "onClientPlayerConnect", playerConnect );
function playerDisconnect( playerid )
{
if( drawScoreboard )
{
fHeight = fHeight - fPaddingPlayer;
}
}
addEventHandler( "onClientPlayerDisconnect", playerDisconnect );
function deviceReset()
{
screenSize = getScreenSize();
}
addEventHandler( "onClientDeviceReset", deviceReset );
function frameRender( post_gui )
{
if( post_gui && drawScoreboard )
{
for( local i = 0; i < MAX_PLAYERS; i++ )
{
if( i != getLocalPlayer() )
{
if( isPlayerConnected(i) )
{
local pos = getPlayerPosition(i);
local rot = getPlayerRotation(i);
local xa = sin(rot[0] * 0.017453292);
local ya = cos(rot[0] * 0.017453292);
dxDrawRectangle(screenSizeHalfX + pos[0].tofloat() * mapPositionScaleX - boxhalfsize - 1 + mapPositionOffsetX,
screenSizeHalfY - pos[1].tofloat() * mapPositionScaleY - boxhalfsize - 1 + mapPositionOffsetY, boxsize + 2, boxsize + 2, fromRGB( 0, 0, 0, 255 ) );
dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa * 10) * mapPositionScaleX - boxhalfsize * 0.5 - 1 + mapPositionOffsetX,
screenSizeHalfY - (pos[1].tofloat() + ya * 10) * mapPositionScaleY - boxhalfsize * 0.5 - 1 + mapPositionOffsetY, boxsize * 0.5 + 2, boxsize * 0.5 + 2, fromRGB( 0, 0, 0, 255 ) );
dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa * 14) * mapPositionScaleX - boxhalfsize * 0.5 - 1 + mapPositionOffsetX,
screenSizeHalfY - (pos[1].tofloat() + ya * 14) * mapPositionScaleY - boxhalfsize * 0.5 - 1 + mapPositionOffsetY, boxsize * 0.5 + 2, boxsize * 0.5 + 2, fromRGB( 0, 0, 0, 255 ) );
dxDrawRectangle(screenSizeHalfX + pos[0].tofloat() * mapPositionScaleX - boxhalfsize + mapPositionOffsetX,
screenSizeHalfY - pos[1].tofloat() * mapPositionScaleY - boxhalfsize + mapPositionOffsetY, boxsize, boxsize, fromRGB( 255, 0, 0, 255 ) );
dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa * 10) * mapPositionScaleX - boxhalfsize * 0.5 + mapPositionOffsetX,
screenSizeHalfY - (pos[1].tofloat() + ya * 10) * mapPositionScaleY - boxhalfsize * 0.5 + mapPositionOffsetY, boxsize * 0.5, boxsize * 0.5, fromRGB( 255, 0, 0, 255 ) );
dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa * 14) * mapPositionScaleX - boxhalfsize * 0.5 + mapPositionOffsetX,
screenSizeHalfY - (pos[1].tofloat() + ya * 14) * mapPositionScaleY - boxhalfsize * 0.5 + mapPositionOffsetY, boxsize * 0.5, boxsize * 0.5, fromRGB( 255, 0, 0, 255 ) );
}
}
else
{
if( isPlayerConnected(i) )
{
local pos = getPlayerPosition(i);
local rot = getPlayerRotation(i);
local xa = sin(rot[0] * 0.017453292);
local ya = cos(rot[0] * 0.017453292);
dxDrawRectangle(screenSizeHalfX + pos[0].tofloat() * mapPositionScaleX - boxhalfsize - 1 + mapPositionOffsetX,
screenSizeHalfY - pos[1].tofloat() * mapPositionScaleY - boxhalfsize - 1 + mapPositionOffsetY, boxsize + 2, boxsize + 2, fromRGB( 0, 0, 0, 255 ) );
dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa * 10) * mapPositionScaleX - boxhalfsize * 0.5 - 1 + mapPositionOffsetX,
screenSizeHalfY - (pos[1].tofloat() + ya * 10) * mapPositionScaleY - boxhalfsize * 0.5 - 1 + mapPositionOffsetY, boxsize * 0.5 + 2, boxsize * 0.5 + 2, fromRGB( 0, 0, 0, 255 ) );
dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa * 14) * mapPositionScaleX - boxhalfsize * 0.5 - 1 + mapPositionOffsetX,
screenSizeHalfY - (pos[1].tofloat() + ya * 14) * mapPositionScaleY - boxhalfsize * 0.5 - 1 + mapPositionOffsetY, boxsize * 0.5 + 2, boxsize * 0.5 + 2, fromRGB( 0, 0, 0, 255 ) );
dxDrawRectangle(screenSizeHalfX + pos[0].tofloat() * mapPositionScaleX - boxhalfsize + mapPositionOffsetX,
screenSizeHalfY - pos[1].tofloat() * mapPositionScaleY - boxhalfsize + mapPositionOffsetY, boxsize, boxsize, fromRGB( 255, 255, 255, 255 ) );
dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa * 10) * mapPositionScaleX - boxhalfsize * 0.5 + mapPositionOffsetX,
screenSizeHalfY - (pos[1].tofloat() + ya * 10) * mapPositionScaleY - boxhalfsize * 0.5 + mapPositionOffsetY, boxsize * 0.5, boxsize * 0.5, fromRGB( 255, 255, 255, 255 ) );
dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa * 14) * mapPositionScaleX - boxhalfsize * 0.5 + mapPositionOffsetX,
screenSizeHalfY - (pos[1].tofloat() + ya * 14) * mapPositionScaleY - boxhalfsize * 0.5 + mapPositionOffsetY, boxsize * 0.5, boxsize * 0.5, fromRGB( 255, 255, 255, 255 ) );
}
}
}
}
}
addEventHandler( "onClientFrameRender", frameRender );
Bu kodları server dosyalarından client'e gelerek yeni .nut formatında dosya açınız ve map.nut olarak kayıt edin.
Sonra vermiş olduğum resim linkini indirip ismini değiştirip map yapıp serverin Files kısmına atın.
Resim: http://i.hizliresim.com/bJ7Wg8.jpg
Map resminin servere eklenmesi için. meta.xml ye client kısmına bu kodu ekleyin.
PHP Kod:
<file>map.jpg</file>
Bu kadar kolay gelsin