[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
RabidHaMsTeR.Org • View topic - Controling announcements duration with web - Help!

Controling announcements duration with web - Help!

For questions about problems with R4 and Bug reports

Moderators: rabidhamster, Rovastar

Controling announcements duration with web - Help!

Postby Ben Kol » Thu Jan 22, 2004 12:48 pm

I am trying to add duration control to announcements through the web interface.
It is not working! Help!

Start of announce_announce.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>R4 Remote Control</TITLE>
</HEAD>
<BODY bgcolor="#000000" text="#FFFFFF" link="#00FF00" vlink="#009933" alink="#FFFF00">
<table><tr><td><a href="index.html"><img src="images/r4.png" border=0></a></td><td><font face="tahoma, verdana" size=5>&&&

</font></td></tr></table>
<font face="tahoma, verdana" size=-1><!-- Loop through all characters in the string and call settweak for each one -->


<!-- Remove announcement -->

<form action="announce_announce.html">
Type the text you wish to announce here:

<input name="cmd" type="hidden" value="set"><br>
<input name="txt" type="text" value="" size=40><br>
Duration: <input name="dur" type="text" value="10" size=3><br>
<input type="submit" value="Display">(Max. 250 chars)
</form>

STOP DISPLAYING</a>
</BODY>
</HTML>
End of announce_announce.html


Start of announcenormal.r4
OVERLAY (
"name" = "Announce Normal";
"author" = "Gordon Williams";
"announce" = "true";
"html" = "announce_announce.html";
TEXTURE font();
GL gl(scenefrom,font);
)


float mytime,c;
int text[256];
int len;
float appearTime;

void settweak(int num,float val) {
if (num==-1) appearTime = val;
if ((num>=0) & (num<255)) { // set the text
text[num] = val;
text[num+1] = 0;
len = 0;
while (text[len]) len = len + 1;
}
}

void init() {
if (appearTime==0) appearTime = 10;
strcpy(gl.shader,"T0;BAa;");
strcpy(font.filename,"ui/font_?.png");
strcpy(text,"ANNOUNCE");
len = 8;
}

void render() {
mytime = mytime + (timepass/appearTime);
if (mytime>1) {
mytime = 1;
finished = 1;
}
c = 1;
if (mytime<0.1) c = (mytime*10.0);
if (mytime>0.9) c = 1.0-((mytime-0.9)*10.0);

gl.clear();
gl.aspect=0;
gl.glTranslate(0,-0.9,-2.414);
gl.glScale(1.8/len,1.8/len,1);

gl.glcolor(1,1,1,c);
gl.glPrint(text,0.0-(len/2.0),len/2.0);
}

void reset() {
mytime = 0;
}
End of announcenormal.r4
Ben Kol
 

Postby rabidhamster » Sat Jan 24, 2004 12:41 pm

rabidhamster
Site Admin
 
Posts: 1100
Joined: Fri Mar 21, 2003 12:31 pm
Location: Cambridge, England

Worki'n fine, thax

Postby Ben Kol » Sun Jan 25, 2004 2:04 pm

Ben Kol
 

Postby rabidhamster » Sun Jan 25, 2004 4:55 pm

rabidhamster
Site Admin
 
Posts: 1100
Joined: Fri Mar 21, 2003 12:31 pm
Location: Cambridge, England

Postby rabidhamster » Sun Jan 25, 2004 8:46 pm

rabidhamster
Site Admin
 
Posts: 1100
Joined: Fri Mar 21, 2003 12:31 pm
Location: Cambridge, England


Return to R4 Bugs/Problems

Who is online

Users browsing this forum: No registered users and 7 guests

cron