Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie
Modyfikacja

Zmiana położenia wiadomości HUDimessage_2.0

Modyfikacja

  • Zamknięty Temat jest zamknięty
4 odpowiedzi w tym temacie

#1 Mandez

    Życzliwy

  • Użytkownik

Reputacja: 2
Nowy

  • Postów:38
  • GG:
  • Steam:steam
  • Imię:Jakub
  • Lokalizacja:Łańcut
Offline

Napisano 14.09.2011 12:01

Witam. CHciałbym zmienić w pluginie położenie wiadomości HUD, ponieważ przysłania mi ją inny plugin. Chciałbym aby była ona w tym miejscu:


Dołączona grafika

Jednak kiedy samodzielnie ustawiam parametry wysokości i szerokości to wiadomość pojawia mi się obok radaru w lewym górnym rogu ekranu. Proszę o pomoc i z góry dziękuje. Poniżej podaje kod SMA:


#include <amxmod>
#include <amxmisc>
#define MAX_MESSAGES 10new g_Messages[MAX_MESSAGES][384]
new g_MessagesNum
new g_Current
new g_teamScore[2]
public plugin_init()
{
register_plugin("Info. Messages 2.1", "1.2", "AMXX Dev Team | 2.0 by graczu")
register_srvcmd("amx_hud_msg", "setMessage")
register_cvar("amx_hud_msgtime", "80")
register_event("TeamScore", "team_score", "a")new lastinfo[8]
get_localinfo("lastinfomsg", lastinfo, 7)
g_Current = str_to_num(lastinfo)
set_localinfo("lastinfomsg", "")
}

public infoMessage()
{
if (g_Current >= g_MessagesNum)
g_Current = 0new hostname[64]
new nextmap[32]
new timeleft = get_timeleft()
new timeformat[32]
new maxrounds = get_cvar_num("mp_maxrounds")
new roundsleft[32]
get_cvar_string("hostname", hostname, 63)
get_cvar_string("amx_nextmap", nextmap, 31)
if (timeleft > 0)
{
new timeleftVar[6]
get_cvar_string("amx_timeleft", timeleftVar, 6)
format(timeformat, 31, "%s", timeleftVar)
} else {
format(timeformat, 31, "No Limit")
}if(maxrounds > 0)
{
format(roundsleft, 31, "%i", maxrounds - (g_teamScore[0] + g_teamScore[1]))
} else {
format(roundsleft, 31, "No Round Limit")
}
new afterReplaceMSG[384]
formatex(afterReplaceMSG, 380, "%s", g_Messages[g_Current])replace(afterReplaceMSG, 380, "%hostname%", hostname)
replace(afterReplaceMSG, 380, "%nextmap%", nextmap)
replace(afterReplaceMSG, 380, "%timeleft%", timeformat)
replace(afterReplaceMSG, 380, "%roundsleft%", roundsleft)
new color1=random_num(0,255)
new color2=random_num(0,255)
new color3=random_num(0,255)set_hudmessage(color1, color2, color3, 0.05, 0.65, 1, 1.0, 10.0, 0.01, 0.1, 3)
show_hudmessage(0, "%s", afterReplaceMSG)
client_print(0, print_console, "%s", afterReplaceMSG)
++g_Current

new Float:freq_im = get_cvar_float("amx_hud_msgtime")

if (freq_im > 0.0)
set_task(freq_im, "infoMessage", 12345)
}
public setMessage()
{
if (g_MessagesNum >= MAX_MESSAGES)
{
return PLUGIN_HANDLED
}remove_task(12345)
read_argv(1, g_Messages[g_MessagesNum], 380)

while (replace(g_Messages[g_MessagesNum], 380, "\n", "^n")) {}

g_MessagesNum++

new Float:freq_im = get_cvar_float("amx_hud_msgtime")

if (freq_im > 0.0)
set_task(freq_im, "infoMessage", 12345)

return PLUGIN_HANDLED
}
public team_score()
{
new team[2]

read_data(1, team, 1)
g_teamScore[(team[0]=='C') ? 0 : 1] = read_data(2)
}public plugin_end()
{
new lastinfo[8]
num_to_str(g_Current, lastinfo, 7)
set_localinfo("lastinfomsg", lastinfo)
}

  • +
  • -
  • 0

#2 Skull3D

    Wszechmogący

  • Zbanowany

Reputacja: 102
Zaawansowany

  • Postów:651
  • Imię:Andrzej
  • Lokalizacja:AMXX.PL
Offline

Napisano 14.09.2011 13:05

W amxx studio masz opcje hud generator
I tam sobie ustaw pozycje i daj napis i bedziesz wiedzial gdzie jest.

a potem SKOMPILUJ
bo chyba tego nie zrobiles

+masz amxx skompilowane


sma -

#include <amxmod>
#include <amxmisc>
#define MAX_MESSAGES  10new g_Messages[MAX_MESSAGES][384]
new g_MessagesNum
new g_Current
new g_teamScore[2]
public plugin_init()
{
register_plugin("Info. Messages 2.1", "1.2", "AMXX Dev Team | 2.0 by graczu")
register_srvcmd("amx_hud_msg", "setMessage")
register_cvar("amx_hud_msgtime", "80")
register_event("TeamScore", "team_score", "a")new lastinfo[8]
get_localinfo("lastinfomsg", lastinfo, 7)
g_Current = str_to_num(lastinfo)
set_localinfo("lastinfomsg", "")
}
 
public infoMessage()
{
if (g_Current >= g_MessagesNum)
  g_Current = 0new hostname[64]
new nextmap[32]
new timeleft = get_timeleft()
new timeformat[32]
new maxrounds = get_cvar_num("mp_maxrounds")
new roundsleft[32]
get_cvar_string("hostname", hostname, 63)
get_cvar_string("amx_nextmap", nextmap, 31)
if (timeleft > 0)
{
  new timeleftVar[6]
  get_cvar_string("amx_timeleft", timeleftVar, 6)
  format(timeformat, 31, "%s", timeleftVar)
} else {
  format(timeformat, 31, "No Limit")
}if(maxrounds > 0)
{
  format(roundsleft, 31, "%i", maxrounds - (g_teamScore[0] + g_teamScore[1]))
} else {
  format(roundsleft, 31, "No Round Limit")
}
new afterReplaceMSG[384]
formatex(afterReplaceMSG, 380, "%s", g_Messages[g_Current])replace(afterReplaceMSG, 380, "%hostname%", hostname)
replace(afterReplaceMSG, 380, "%nextmap%", nextmap)
replace(afterReplaceMSG, 380, "%timeleft%", timeformat)
replace(afterReplaceMSG, 380, "%roundsleft%", roundsleft)
new color1=random_num(0,255)
new color2=random_num(0,255)
new color3=random_num(0,255)set_hudmessage(color1, color2, color3, 0.54, 0.66, 1, 1.0, 10.0, 0.01, 0.1, 3)
show_hudmessage(0, "%s", afterReplaceMSG)
client_print(0, print_console, "%s", afterReplaceMSG)
++g_Current
 
new Float:freq_im = get_cvar_float("amx_hud_msgtime")
 
if (freq_im > 0.0)
  set_task(freq_im, "infoMessage", 12345)
}
public setMessage()
{
if (g_MessagesNum >= MAX_MESSAGES)
{
  return PLUGIN_HANDLED
}remove_task(12345)
read_argv(1, g_Messages[g_MessagesNum], 380)
 
while (replace(g_Messages[g_MessagesNum], 380, "\n", "^n")) {}
 
g_MessagesNum++
 
new Float:freq_im = get_cvar_float("amx_hud_msgtime")
 
if (freq_im > 0.0)
  set_task(freq_im, "infoMessage", 12345)
 
return PLUGIN_HANDLED
}
public team_score()
{
new team[2]
 
read_data(1, team, 1)
g_teamScore[(team[0]=='C') ? 0 : 1] = read_data(2)
}public plugin_end()
{
new lastinfo[8]
num_to_str(g_Current, lastinfo, 7)
set_localinfo("lastinfomsg", lastinfo)
}


Skompiluj w amxx.pl/kompilator

Użytkownik Skull3D edytował ten post 14.09.2011 16:42


#3 Droso

    Dawniej HubertTM

  • Support Team

Reputacja: 1 291
Godlike

  • Postów:2 371
  • Steam:steam
  • Imię:Hubert
  • Lokalizacja:Wrocław
Offline

Napisano 14.09.2011 14:39

#include <amxmod>
#include <amxmisc>
#define MAX_MESSAGES  10new g_Messages[MAX_MESSAGES][384]
new g_MessagesNum
new g_Current
new g_teamScore[2]
public plugin_init()
{
register_plugin("Info. Messages 2.1", "1.2", "AMXX Dev Team | 2.0 by graczu")
register_srvcmd("amx_hud_msg", "setMessage")
register_cvar("amx_hud_msgtime", "80")
register_event("TeamScore", "team_score", "a")new lastinfo[8]
get_localinfo("lastinfomsg", lastinfo, 7)
g_Current = str_to_num(lastinfo)
set_localinfo("lastinfomsg", "")
}

public infoMessage()
{
if (g_Current >= g_MessagesNum)
  g_Current = 0new hostname[64]
new nextmap[32]
new timeleft = get_timeleft()
new timeformat[32]
new maxrounds = get_cvar_num("mp_maxrounds")
new roundsleft[32]
get_cvar_string("hostname", hostname, 63)
get_cvar_string("amx_nextmap", nextmap, 31)
if (timeleft > 0)
{
  new timeleftVar[6]
  get_cvar_string("amx_timeleft", timeleftVar, 6)
  format(timeformat, 31, "%s", timeleftVar)
} else {
  format(timeformat, 31, "No Limit")
}if(maxrounds > 0)
{
  format(roundsleft, 31, "%i", maxrounds - (g_teamScore[0] + g_teamScore[1]))
} else {
  format(roundsleft, 31, "No Round Limit")
}
new afterReplaceMSG[384]
formatex(afterReplaceMSG, 380, "%s", g_Messages[g_Current])replace(afterReplaceMSG, 380, "%hostname%", hostname)
replace(afterReplaceMSG, 380, "%nextmap%", nextmap)
replace(afterReplaceMSG, 380, "%timeleft%", timeformat)
replace(afterReplaceMSG, 380, "%roundsleft%", roundsleft)
new color1=random_num(0,255)
new color2=random_num(0,255)
new color3=random_num(0,255)set_hudmessage(color1, color2, color3, 0.54, 0.66, 1, 1.0, 10.0, 0.01, 0.1, 3)
show_hudmessage(0, "%s", afterReplaceMSG)
client_print(0, print_console, "%s", afterReplaceMSG)
++g_Current

new Float:freq_im = get_cvar_float("amx_hud_msgtime")

if (freq_im > 0.0)
  set_task(freq_im, "infoMessage", 12345)
}
public setMessage()
{
if (g_MessagesNum >= MAX_MESSAGES)
{
  return PLUGIN_HANDLED
}remove_task(12345)
read_argv(1, g_Messages[g_MessagesNum], 380)

while (replace(g_Messages[g_MessagesNum], 380, "\n", "^n")) {}

g_MessagesNum++

new Float:freq_im = get_cvar_float("amx_hud_msgtime")

if (freq_im > 0.0)
  set_task(freq_im, "infoMessage", 12345)

return PLUGIN_HANDLED
}
public team_score()
{
new team[2]

read_data(1, team, 1)
g_teamScore[(team[0]=='C') ? 0 : 1] = read_data(2)
}public plugin_end()
{
new lastinfo[8]
num_to_str(g_Current, lastinfo, 7)
set_localinfo("lastinfomsg", lastinfo)
}

Look
  • +
  • -
  • 1

Piszę pluginy pod: AMX MOD X oraz SOURCE MOD!

Na zlecenie i bez zlecenia zresztą też!


#4 Mandez

    Życzliwy

  • Autor tematu
  • Użytkownik

Reputacja: 2
Nowy

  • Postów:38
  • GG:
  • Steam:steam
  • Imię:Jakub
  • Lokalizacja:Łańcut
Offline

Napisano 14.09.2011 23:01

używałem i generatora i kompilatora, no ale coś widocznie nie wychodziło, oba pluginy po skompilowaniu działają poprawnie :) Dzięki i można zamknąć temat ;)
  • +
  • -
  • 0

#5 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7 490
  • Lokalizacja:AMXX.PL
Offline

Napisano 15.09.2011 07:39

Wiadomość wygenerowana automatycznie


Ten temat został zamknięty przez moderatora.

Powód: rozwiązane

Jeśli się z tym nie zgadzasz, Dołączona grafika raportuj ten post, a moderator lub administrator rozpatrzy go ponownie.


Z pozdrowieniami,
Zespół AMXX.PL





Również z jednym lub większą ilością słów kluczowych: Modyfikacja

Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych