[Help] Death Message Fading - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [Help] Death Message Fading (
/showthread.php?tid=473463)
[Help] Death Message Fading -
0Z3ro0 - 02.11.2013
Hey guys and gals. I recently added death messages to my server, but quickly found out they stay there forever and never fade away. This can get annoying at times, so I am wondering if there is some code I could add that would make the death messages and login messages fade away after say 2 minutes.
Thanks for reading and have a wonderful day everyone!
-
0Z3ro0
Re: [Help] Death Message Fading -
0Z3ro0 - 03.11.2013
Bumb*
Anyone know about this?
Re: [Help] Death Message Fading -
0Z3ro0 - 03.11.2013
Quote:
Originally Posted by -Prodigy-
Well, you can't hide them. What you can do is send a blank message 5 times to get rid of the current death messages. If you want something like this, then give this a try:
pawn Код:
public OnPlayerDeath(..) { SendDeathMessage(killerid, playerid, reason), SetTimer("cleardm", 120000, false); // You can either do it this way or set a global timer that repeats return 1; }
forward cleardm(); public cleardm() { for(new g = 0; g < 5; g++) SendDeathMessage(255, 24, 255); return 1; }
|
Thank you for your help. Sending 5 blank messages is fine, I am not making this server for commercial use, I just want an enjoyable server to play on, so "working around the bush" is not a problem for me. My I ask you to break down this code please? Rather then copy and paste it I would like to learn what it means and how it works.
Re: [Help] Death Message Fading -
Unte99 - 03.11.2013
With what are you using the messages ? With textdraws, gametext or something else ?
Re: [Help] Death Message Fading -
0Z3ro0 - 03.11.2013
Quote:
Originally Posted by Unte99
With what are you using the messages ? With textdraws, gametext or something else ?
|
Код:
public OnPlayerDeath(playerid, killerid, reason)
{
SendDeathMessage(killerid, playerid, reason);
return 1;
}
Re: [Help] Death Message Fading -
-Prodigy- - 03.11.2013
Well, you can't hide them. What you can do is send a blank message 5 times to get rid of the current death messages. If you want something like this, then give this a try:
pawn Код:
public OnPlayerDeath(..)
{
SendDeathMessage(killerid, playerid, reason), SetTimer("cleardm", 120000, false); // You can either do it this way or set a global timer that repeats
return 1;
}
forward cleardm();
public cleardm()
{
for(new g = 0; g < 5; g++)
SendDeathMessage(255, 24, 255);
return 1;
}