AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hudmessage (https://forums.alliedmods.net/showthread.php?t=53769)

ZooYork 04-10-2007 14:38

Hudmessage
 
How to make hudmessage to pulse and make it to random colors every second?

Alka 04-10-2007 15:13

Re: Hudmessage
 
for pulse effect set effects = 1 ! Ex:

Code:

set_hudmessage(0,255, 0, 0.30, 0.85, 1, 6.0, 6.0);
0,255,0 = colors
0.30,0.85 = position
1 = effect
6.0 = fx time
6.0 = hold time

ZooYork 04-10-2007 15:58

Re: Hudmessage
 
Quote:

Originally Posted by Alka (Post 463052)
for pulse effect set effects = 1 ! Ex:

Code:

set_hudmessage(0,255, 0, 0.30, 0.85, 1, 6.0, 6.0);
0,255,0 = colors
0.30,0.85 = position
1 = effect
6.0 = fx time
6.0 = hold time

PHP Code:

#include <amxmodx>
 
public plugin_init()
{
 
register_clcmd("say /kill""cmdTest")
 
}
 
public 
cmdTest(id)
{
new 
playername[18
get_user_name(idplayername17)
 
ColorChat(0GREEN"^x04[test] %s made suicide^x04""playername""green");
user_kill id1)
return 
PLUGIN_HANDLED;


What else i need to add that it would work?
EDIT: i mean playername

Code:

It shows as: [test] playername made suicide

Nican 04-10-2007 16:24

Re: Hudmessage
 
ColorChat(0, GREEN, "^x04[test] %s made suicide^x04", playername, "green"); ?

Alka 04-10-2007 16:26

Re: Hudmessage
 
=>> Dunno what you are trying to do
PHP Code:

#include <amxmodx>
#define MAXSLOTS 32
enum Color
{
YELLOW 1,
GREEN,
TEAM_COLOR,
GREY,
RED,
BLUE
}
new 
TeamName[][] = 
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}
new 
bool:IsConnected[MAXSLOTS 1];
new 
TeamInfoSayTextMaxSlots;
public 
plugin_init()
{
register_clcmd("say /kill""cmdTest");
TeamInfo get_user_msgid("TeamInfo");
SayText get_user_msgid("SayText");
MaxSlots get_maxplayers();
}
public 
cmdTest(id)
{
new 
pname[32
get_user_name(idpname31)
console_cmd(id,"kill")
ColorChat(0GREEN"[^x04test^x01] ^x03%s made suicide!",pname);
}
public 
ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
static 
message[256];
switch(
type)

case 
YELLOW:
{
message[0] = 0x01;
}
case 
GREEN:
{
message[0] = 0x04;
}
default:
{
message[0] = 0x03;
}
}
vformat(message[1], 251msg4);
message[192] = '^0';
new 
teamColorChangeindexMSG_Type;
if(!
id)
{
index FindPlayer();
MSG_Type MSG_ALL;
} else {
MSG_Type MSG_ONE;
index id;
}
team get_user_team(index); 
ColorChange ColorSelection(indexMSG_Typetype);
ShowColorMessage(indexMSG_Typemessage);
if(
ColorChange)
{
Team_Info(indexMSG_TypeTeamName[team]);
}
}
ShowColorMessage(idtypemessage[])
{
message_begin(typeSayText_id);
write_byte(id)  
write_string(message);
message_end(); 
}
Team_Info(idtypeteam[])
{
message_begin(typeTeamInfo_id);
write_byte(id);
write_string(team);
message_end();
return 
1;
}
ColorSelection(indextypeColor:Type)
{
switch(
Type)
{
case 
RED:
{
return 
Team_Info(indextypeTeamName[1]);
}
case 
BLUE:
{
return 
Team_Info(indextypeTeamName[2]);
}
case 
GREY:
{
return 
Team_Info(indextypeTeamName[0]);
}
}
return 
0;
}
FindPlayer()
{
new 
= -1;
while(
<= MaxSlots)
{
if(
IsConnected[++i])
{
return 
i;
}
}
return -
1;


Updated!

ZooYork 04-10-2007 16:29

Re: Hudmessage
 
Quote:

Originally Posted by Alka (Post 463073)
=>> Dunno what you are trying to do
PHP Code:

#include <amxmodx>
 
#define MAXSLOTS 32
 
enum Color
{
YELLOW 1,
GREEN,
TEAM_COLOR,
GREY,
RED,
BLUE
}
 
new 
TeamName[][] = 
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}
 
new 
bool:IsConnected[MAXSLOTS 1];
new 
TeamInfoSayTextMaxSlots;
 
public 
plugin_init()
{
register_clcmd("say /kill""cmdTest");
 
TeamInfo get_user_msgid("TeamInfo");
SayText get_user_msgid("SayText");
MaxSlots get_maxplayers();
}
 
public 
cmdTest(id)
{
new 
playername[32
get_user_name(idplayername31)
ColorChat(0GREEN"[^x04test^x01] ^x03%s made suicide!",playername);
user_kill id1)
}
 
public 
ColorChat(idColor:type, const msg[], {Float,Sql,Result,_}:...)
{
static 
message[256];
switch(
type)

case 
YELLOW:
{
message[0] = 0x01;
}
case 
GREEN:
{
message[0] = 0x04;
}
default:
{
message[0] = 0x03;
}
}
vformat(message[1], 251msg4);
message[192] = '^0';
new 
teamColorChangeindexMSG_Type;
if(!
id)
{
index FindPlayer();
MSG_Type MSG_ALL;
} else {
MSG_Type MSG_ONE;
index id;
}
team get_user_team(index); 
ColorChange ColorSelection(indexMSG_Typetype);
ShowColorMessage(indexMSG_Typemessage);
if(
ColorChange)
{
Team_Info(indexMSG_TypeTeamName[team]);
}
}
ShowColorMessage(idtypemessage[])
{
message_begin(typeSayText_id);
write_byte(id)  
write_string(message);
message_end(); 
}
Team_Info(idtypeteam[])
{
message_begin(typeTeamInfo_id);
write_byte(id);
write_string(team);
message_end();
return 
1;
}
ColorSelection(indextypeColor:Type)
{
switch(
Type)
{
case 
RED:
{
return 
Team_Info(indextypeTeamName[1]);
}
case 
BLUE:
{
return 
Team_Info(indextypeTeamName[2]);
}
case 
GREY:
{
return 
Team_Info(indextypeTeamName[0]);
}
}
return 
0;
}
FindPlayer()
{
new 
= -1;
while(
<= MaxSlots)
{
if(
IsConnected[++i])
{
return 
i;
}
}
return -
1;



You know i got that part already coded, but it wont show the playername who typed the command.
EDIT: As i said before it shows like:
Code:

[test] playername made suicide

Alka 04-10-2007 16:49

Re: Hudmessage
 
hmmm...dunno! i try to make something...

pRED* 04-10-2007 17:41

Re: Hudmessage
 
Code:
new temp[128]; format(temp,127,"[^x04test^x01] ^x03%s made suicide!",playername) ColorChat(0, GREEN, temp);

ZooYork 04-10-2007 17:53

Re: Hudmessage
 
Quote:

Originally Posted by pRED* | NZ (Post 463106)
Code:
new temp[128];</p><p>&nbsp;</p><p>format(temp,127,"[^x04test^x01] ^x03%s made suicide!",playername)</p><p>&nbsp;</p><p>ColorChat(0, GREEN, temp);

it worked, but still how can i make random effect to something? "little" tutorial about that would be nice ;)

teame06 04-10-2007 17:53

Re: Hudmessage
 
Quote:

Originally Posted by pRED* | NZ (Post 463106)
Code:
new temp[128]; format(temp,127,"[^x04test^x01] ^x03%s made suicide!",playername) ColorChat(0, GREEN, temp);

The stock ColorChat allow so you don't have to do pre formating like that but you always can do that.


@ ZooYork

Have you even tried the change Alka did? Cause his/her looks correct


All times are GMT -4. The time now is 06:39.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.