romegames 1
romegames
Krutzo 1
Krutzo
shrpnl 1
shrpnl
Best Studio 1
Best Studio
D 1
delimuratt
Aliyldrim 1
Aliyldrim
Mt2Hizmet 1
Mt2Hizmet
noisiv 1
noisiv
Manwe Work 1
Manwe Work
Hikaye Ekle
Reklam vermek için turkmmo@gmail.com

Map index numarası ile map'a ışınlanma

  • Konuyu başlatan Konuyu başlatan Breacche
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 18
  • Görüntüleme Görüntüleme 1K

Breacche

Level 2
Üye
Katılım
9 Mar 2022
Konular
21
Mesajlar
84
Çözüm
3
Online süresi
1mo 16h
Reaksiyon Skoru
56
Altın Konu
0
Başarım Puanı
60
MmoLira
5,893
DevLira
6
Ticaret - 0%
0   0   0

ROHAN2 WORLD 1-120 TR TİPİ OFFICIAL YOHARA, BALATHOR VE AMON! 80. GÜNÜNDE! +10.000 ONLİNE! HİLE VE BOT %100 ENGELLİ HEMEN TIKLA!

map'a kordinat ile ışınlama zahmetli geldiği için şöyle bir şey yaptım /goto 72 ( map kodu ile) mapın merkez noktasına ışınlanırsınız








cmd_gm.cpp
Ara
ACMD(do_goto)

Değiştir

[CODE lang="cpp" highlight="ACMD(do_goto)"]ACMD(do_goto)
{
char arg1[256], arg2[256];
int x = 0, y = 0, z = 0;

two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));

if (!*arg1 && !*arg2)
{
ch->ChatPacket(CHAT_TYPE_INFO, "Usage: goto <x meter> <y meter>");
return;
}

if (isnhdigit(*arg1) && isnhdigit(*arg2))
{
str_to_number(x, arg1);
str_to_number(y, arg2);

PIXEL_POSITION p;

if (SECTREE_MANAGER::instance().GetMapBasePosition(ch->GetX(), ch->GetY(), p))
{
x += p.x / 100;
y += p.y / 100;
}

ch->ChatPacket(CHAT_TYPE_INFO, "You goto ( %d, %d )", x, y);
}
else if (*arg1 && !*arg2 && isnhdigit(*arg1))
{
bool bAllDigits = true;
for (const char* p = arg1; *p; ++p)
if (!isdigit(*p)) { bAllDigits = false; break; }

if (bAllDigits)
{
int mapIndexNumber = 0;
str_to_number(mapIndexNumber, arg1);
PIXEL_POSITION centerPos;
if (SECTREE_MANAGER::instance().GetCenterPositionOfMap(mapIndexNumber, centerPos))
{
ch->ChatPacket(CHAT_TYPE_INFO, "You goto map %d center ( %d, %d )", mapIndexNumber, centerPos.x, centerPos.y);
ch->WarpSet(centerPos.x, centerPos.y);
ch->Stop();
return;
}
else
{
ch->ChatPacket(CHAT_TYPE_INFO, "Map %d not found. Usage: /goto <x> <y> | /goto <mapIndex> | /goto <name> [empire]", mapIndexNumber);
return;
}
}
}
else
{
int mapIndex = 0;
BYTE empire = 0;

if (*arg1 == '#')
str_to_number(mapIndex, (arg1 + 1));

if (*arg2 && isnhdigit(*arg2))
{
str_to_number(empire, arg2);
empire = MINMAX(1, empire, 3);
}
else
empire = ch->GetEmpire();

if (!CHARACTER_GoToName(ch, empire, mapIndex, arg1))
{
ch->ChatPacket(CHAT_TYPE_INFO, "Cannot find map. Syntax: /goto <mapname> [empire] | /goto <x> <y> | /goto <mapIndex>");
}
return;
}

x *= 100;
y *= 100;

ch->Show(ch->GetMapIndex(), x, y, z);
ch->Stop();
}[/CODE]


alıntı vermeden calanı severim :D
 
paylaşım için teşşekürler kolaylık olmus eline sağlık
 
Paylaşım için teşekkürler.
 

Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)

Geri
Üst