new Float:X[33] new Float:Y[33]
Potem podczas zmiany pozycji ustaw jakąś wielkość np. X[id] = 0.15 | Y[id] = 0.3
To równanie zostało stworzone przy pomocy kodu LaTeX:
Edytor LaTeX online: CodeCogs.com/latex/eqneditor.php
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.
|
Napisane przez speedkill
w 13.11.2012 17:55
Napisane przez Filip1512
w 05.11.2012 23:49
#include <amxmodx>
#include <amxmisc>
#include <csx>
#define PLUGIN "HUD"
#define AUTHOR " glut // edit Marcin"
#define VERSION "1.0"
new gVotemenu;
new float:coordx;
new float:coordy;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /hudmenu", "hudmenu")
gVotemenu=menu_create ("Z ktorej strony chcesz miec HUD?", "cVotemenu");
menu_additem(gVotemenu,"Lewej");
menu_additem(gVotemenu,"Po srodku");
menu_additem(gVotemenu,"Prawej");
}
public client_putinserver(id)
{
set_task(0.1, "pokaz_hud", id,_,_,"b");
menu_display(id, gVotemenu, 0);
}
public hudmenu(id)
menu_display(id, gVotemenu, 0);
public cVotemenu(id, menu, item){
switch(item){
case 0:{
coordx = 0.2
coordy = 0.3
}
case 1:{
coordx = -1.0
coordy = 0.05
}
case 2:{
coordx = 0.8
coordy = 0.3
}
}
}
public pokaz_hud(id)
{
new stats[8],bodyhits[8],rankpos,rankmax;
rankpos = get_user_stats(id, stats, bodyhits)
rankmax = get_statsnum()
new izStats[ 8 ], izBody[ 8 ];
new szData[10];
get_time( "%X", szData, 9 );
new hp = get_user_health(id)
new ar = get_user_armor(id)
new rank = get_user_stats( id, izStats, izBody )
new fragi = get_user_frags(id)
new dedy = get_user_deaths(id)
new czas_mapy = get_timeleft()
new name[32]
get_user_name(id, name, 31)
if(is_user_connected(id))
{
set_hudmessage(255, 255, 0, floatstr(coordx), floatstr(coordy), 0, 0.0, 0.3, 0.0, 0.0);
show_hudmessage(id, "[Nick: %s]^n[Zycie: %i | Armor: %i]^n[Fragi: %i | Zginiecia: %i]^n[Rank: %d/%d]^n[Forum: www-cs-SopliCa.com]",name,hp, ar, fragi, dedy, rankpos, rankmax)
}
else
{
remove_task(id)
}
return PLUGIN_HANDLED
}
#include <amxmodx>
#include <amxmisc>
#include <csx>
#define PLUGIN "HUD"
#define AUTHOR " glut // edit Marcin"
#define VERSION "1.0"
new gVotemenu;
new coord;
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /hudmenu", "hudmenu")
gVotemenu=menu_create ("Z ktorej strony chcesz miec HUD?", "cVotemenu");
menu_additem(gVotemenu,"Lewej");
menu_additem(gVotemenu,"Po srodku");
menu_additem(gVotemenu,"Prawej");
}
public client_putinserver(id)
{
set_task(0.1, "pokaz_hud", id,_,_,"b");
menu_display(id, gVotemenu, 0);
}
public hudmenu(id)
menu_display(id, gVotemenu, 0);
public cVotemenu(id, menu, item){
switch(item){
case 0:{
coord = 1
}
case 1:{
coord = 2
}
case 2:{
coord = 3
}
}
}
public pokaz_hud(id)
{
new stats[8],bodyhits[8],rankpos,rankmax;
rankpos = get_user_stats(id, stats, bodyhits)
rankmax = get_statsnum()
new izStats[ 8 ], izBody[ 8 ];
new szData[10];
get_time( "%X", szData, 9 );
new hp = get_user_health(id)
new ar = get_user_armor(id)
new rank = get_user_stats( id, izStats, izBody )
new fragi = get_user_frags(id)
new dedy = get_user_deaths(id)
new czas_mapy = get_timeleft()
new name[32]
get_user_name(id, name, 31)
if(is_user_connected(id)){
if(coord == 1){
set_hudmessage(255, 255, 0, 0.2, 0.3, 0, 0.0, 0.3, 0.0, 0.0);
show_hudmessage(id, "[Nick: %s]^n[Zycie: %i | Armor: %i]^n[Fragi: %i | Zginiecia: %i]^n[Rank: %d/%d]^n[Forum: www-cs-SopliCa.com]",name,hp, ar, fragi, dedy, rankpos, rankmax)
}
if(coord == 2){
set_hudmessage(255, 255, 0, -1.0, 0.05, 0, 0.0, 0.3, 0.0, 0.0);
show_hudmessage(id, "[Nick: %s]^n[Zycie: %i | Armor: %i]^n[Fragi: %i | Zginiecia: %i]^n[Rank: %d/%d]^n[Forum: www-cs-SopliCa.com]",name,hp, ar, fragi, dedy, rankpos, rankmax)
}
if(coord == 3){
set_hudmessage(255, 255, 0, 0.8, 0.3, 0, 0.0, 0.3, 0.0, 0.0);
show_hudmessage(id, "[Nick: %s]^n[Zycie: %i | Armor: %i]^n[Fragi: %i | Zginiecia: %i]^n[Rank: %d/%d]^n[Forum: www-cs-SopliCa.com]",name,hp, ar, fragi, dedy, rankpos, rankmax)
}
}
else
{
remove_task(id)
}
return PLUGIN_HANDLED
}
Napisane przez soja
w 26.10.2008 20:24
set_hudmessage ( red=200, green=100, blue=0, Float:x=-1.0, Float:y=0.35, effects=0, Float:fxtime=6.0, Float:holdtime=12.0, Float:fadeintime=0.1, Float:fadeouttime=0.2, channel=4 )Teraz po kolei:
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 7.0) show_hudmessage(id, "Witaj!")Powyższy kod ustawia czerwoną wiadomość "Witaj!" dokładnie na środku ekranu, wyświetlaną przez 7 sekund.
show_hudmessage ( index, message[], ... )index - ID gracza (1-32). Jeśli zostanie ustawiony na 0, wiadomość będzie widoczna dla wszystkich graczy.
show_hudmessage(id, "Witaj!")Wiadomość możemy również formatować:
show_hudmessage(id, "Twoje hp: %d", player_hp)Aby opuścić linijkę należy użyć sekwencji: ^n
show_hudmessage(id, "Linia nr1!^nLinia nr2!")* W jednej wiadomości możemy użyc maksymalnie 479 znaków.
Napisane przez Drzanas
w 18.05.2012 13:22
Napisane przez ogieR8
w 17.05.2012 18:45