Konuyu Oyla:
  • Derecelendirme: 0/5 - 0 oy
  • 1
  • 2
  • 3
  • 4
  • 5
Servera harita ekleme.
#1
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.
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.0fTopToTitles 25.0;
local fWidth 600.0fHeightDef = ((fPadding 2) + (fTopToTitles 3));
local fHeight fHeightDef;
local fOffsetID 50.0fOffsetName 450.0;
local fPaddingPlayer 20.0;
local fX 0.0fY 0.0fOffsetX 0.0fOffsetY 0.0;

local mapScale 1024 3500.0;
local map guiCreateElement13"map.jpg"screenSize[0] * 0.5 3500.0 0.5 mapScalescreenSize[1] * 0.5 3033.0 0.5 mapScale3500.0 mapScale3033.0 mapScale );
guiSetVisible(mapfalse);

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;
showChatfalse );
guiSetVisible(maptrue);
guiSetAlpha(map0.64);


fHeight fHeightDef;
for( 
local i 0MAX_PLAYERSi++ )
{
if( 
isPlayerConnected(i) )
fHeight += fPaddingPlayer;
}
}
bindKey"m""down"tabDown );

function 
tabUp()
{
drawScoreboard false;
showChattrue );
guiSetVisible(mapfalse);
guiSetAlpha(map0);

// Reset the height
fHeight = ((fPadding 2) + (fTopToTitles 3));
}
bindKey"m""up"tabUp );

function 
playerConnectplayeridnickname )
{

if( 
drawScoreboard )
fHeight += fPaddingPlayer;
}
addEventHandler"onClientPlayerConnect"playerConnect );

function 
playerDisconnectplayerid )
{

if( 
drawScoreboard )
{

fHeight fHeight fPaddingPlayer;
}
}
addEventHandler"onClientPlayerDisconnect"playerDisconnect );

function 
deviceReset()
{

screenSize getScreenSize();
}
addEventHandler"onClientDeviceReset"deviceReset );

function 
frameRenderpost_gui )
{
if( 
post_gui && drawScoreboard )
{


for( 
local i 0MAX_PLAYERSi++ )
{
if( 
!= 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 mapPositionOffsetX,
                   screenSizeHalfY pos[1].tofloat() * mapPositionScaleY boxhalfsize mapPositionOffsetYboxsize 2boxsize 2fromRGB000255 ) );
       
dxDrawRectangle
(screenSizeHalfX + (pos[0].tofloat() + xa 10) * mapPositionScaleX boxhalfsize 0.5 mapPositionOffsetX,
                   screenSizeHalfY - (pos[1].tofloat() + ya 10) * mapPositionScaleY boxhalfsize 0.5 mapPositionOffsetYboxsize 0.5 2boxsize 0.5 2fromRGB000255 ) );

dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa 14) * mapPositionScaleX boxhalfsize 0.5 mapPositionOffsetX,
                   screenSizeHalfY - (pos[1].tofloat() + ya 14) * mapPositionScaleY boxhalfsize 0.5 mapPositionOffsetYboxsize 0.5 2boxsize 0.5 2fromRGB000255 ) );

dxDrawRectangle(screenSizeHalfX pos[0].tofloat() * mapPositionScaleX boxhalfsize mapPositionOffsetX,
                   screenSizeHalfY pos[1].tofloat() * mapPositionScaleY boxhalfsize mapPositionOffsetYboxsizeboxsizefromRGB25500255 ) );

dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa 10) * mapPositionScaleX boxhalfsize 0.5 mapPositionOffsetX,
                   screenSizeHalfY - (pos[1].tofloat() + ya 10) * mapPositionScaleY boxhalfsize 0.5 mapPositionOffsetYboxsize 0.5boxsize 0.5fromRGB25500255 ) );

dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa 14) * mapPositionScaleX boxhalfsize 0.5 mapPositionOffsetX,
                   screenSizeHalfY - (pos[1].tofloat() + ya 14) * mapPositionScaleY boxhalfsize 0.5 mapPositionOffsetYboxsize 0.5boxsize 0.5fromRGB25500255 ) );
}
}
else
{
   ifisPlayerConnected(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 mapPositionOffsetX,
                   screenSizeHalfY pos[1].tofloat() * mapPositionScaleY boxhalfsize mapPositionOffsetYboxsize 2boxsize 2fromRGB000255 ) );
       
dxDrawRectangle
(screenSizeHalfX + (pos[0].tofloat() + xa 10) * mapPositionScaleX boxhalfsize 0.5 mapPositionOffsetX,
                   screenSizeHalfY - (pos[1].tofloat() + ya 10) * mapPositionScaleY boxhalfsize 0.5 mapPositionOffsetYboxsize 0.5 2boxsize 0.5 2fromRGB000255 ) );

dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa 14) * mapPositionScaleX boxhalfsize 0.5 mapPositionOffsetX,
                   screenSizeHalfY - (pos[1].tofloat() + ya 14) * mapPositionScaleY boxhalfsize 0.5 mapPositionOffsetYboxsize 0.5 2boxsize 0.5 2fromRGB000255 ) );

dxDrawRectangle(screenSizeHalfX pos[0].tofloat() * mapPositionScaleX boxhalfsize mapPositionOffsetX,
                   screenSizeHalfY pos[1].tofloat() * mapPositionScaleY boxhalfsize mapPositionOffsetYboxsizeboxsizefromRGB255255255255 ) );

dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa 10) * mapPositionScaleX boxhalfsize 0.5 mapPositionOffsetX,
                   screenSizeHalfY - (pos[1].tofloat() + ya 10) * mapPositionScaleY boxhalfsize 0.5 mapPositionOffsetYboxsize 0.5boxsize 0.5fromRGB255255255255 ) );

dxDrawRectangle(screenSizeHalfX + (pos[0].tofloat() + xa 14) * mapPositionScaleX boxhalfsize 0.5 mapPositionOffsetX,
                   screenSizeHalfY - (pos[1].tofloat() + ya 14) * mapPositionScaleY boxhalfsize 0.5 mapPositionOffsetYboxsize 0.5boxsize 0.5fromRGB255255255255 ) );
}
}
}
}
}
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  Wink
[Resim: 1233869.png]
Youtube Kanalım: TIKLA /\  İnternet hızım: TIKLA
Cevapla
#2
@ Bu arada harita M tuşuna bastığınızda açılır.
[Resim: 1233869.png]
Youtube Kanalım: TIKLA /\  İnternet hızım: TIKLA
Cevapla


Hızlı Menü: