Clock 3D in game -
sirvasy - 26.10.2013
Is very simple to created
windows screen capture
image upload
if you want a different location, change the location
curent location is [895.0890, -1101.9412, 35.5424]
Download link
Re: Clock 3D in game -
Wizzy951 - 26.10.2013
Nice one!
Re: Clock 3D in game -
coool - 26.10.2013
Looking Nice.
Re: Clock 3D in game -
ragu1987 - 26.10.2013
bro how to get
Re: Clock 3D in game -
HardRock - 26.10.2013
Quote:
Originally Posted by ragu1987
bro how to get

|
With TextDraws.
Re: Clock 3D in game -
Hamam - 26.10.2013
Good job
AW: Clock 3D in game -
BigETI - 26.10.2013
It will just create a new 3D text label every second without destroying the older ones. Also it's wrong to use gettime() after format().
Actually you don't need ternary operators at all to generate this string. format() allows you to limit the amount of characters you want to use to display numbers as a string.
pawn Код:
format(string, sizeof string, "{00C0FF}%02d {F300FF}: {FFAF00}%02d {F300FF}: {F81414}%02d", hours, minutes, seconds);
By the way
is too huge and just wastes useful memory...
Re: Clock 3D in game -
IstuntmanI - 26.10.2013
This one is very bad scripted (see BigETI's post), I made a better version, doing the same thing but much more efficiently:
pawn Код:
/*
+++++++ ++++++ +++ +++ ++ ++
+++ + ++ + + + + + +
++ ++++++ +++ +++ + +
*/
#include <a_samp>
new Text3D:giClock,
giTime[ 3 ],
gsString[ 128 ];
public OnFilterScriptInit()
{
giClock = Create3DTextLabel( " ", 0xFFFFFFFF, 895.0890, -1101.9412, 35.5424, 200.0, 0 );
SetTimer( "UpdateClock", 1000, true );
return 1;
}
forward UpdateClock( );
public UpdateClock( )
{
gettime( giTime[ 0 ], giTime[ 1 ], giTime[ 2 ] );
format( gsString, 128, "{00C0FF}Clock {FFAF00}By {F81414}Teddy\n{00C0FF}%02d{F300FF}:{FFAF00}%02d{F300FF}:{F81414}%02d", hours, minutes, seconds );
Update3DTextLabelText( giClock, 0xFFFFFFFF, gsString );
}
Re: AW: Clock 3D in game -
Pottus - 26.10.2013
Quote:
Originally Posted by BigETI
It will just create a new 3D text label every second without destroying the older ones. Also it's wrong to use gettime() after format().
Actually you don't need ternary operators at all to generate this string. format() allows you to limit the amount of characters you want to use to display numbers as a string.
pawn Код:
format(string, sizeof string, "{00C0FF}%02d {F300FF}: {FFAF00}%02d {F300FF}: {F81414}%02d", hours, minutes, seconds);
By the way
is too huge and just wastes useful memory...
|
I respectfully disagree that the amount of memory wasted has and significant it is literally a drop in a glass of water

But yes why use strings longer than needed? I wanted it to the test to see if format takes longer to format strings with the same text but different sizes it would seem string length doesn't matter but I thought it would until I tested it. Conclusion still no excuse to use excessive sized strings it really boils down to bad practice.
Try running the following code on this site:
http://slice-vps.nl:7070/
pawn Код:
#include <a_samp>
main() {
new string1[512];
new string2[32];
new tc = GetTickCount();
for(new i = 0; i < 100000; i++)
{
format(string1, sizeof(string1), "Testing");
}
printf("String1[512] tool %i ticks", GetTickCount() - tc);
tc = GetTickCount();
for(new i = 0; i < 100000; i++)
{
format(string2, sizeof(string2), "Testing");
}
printf("String2[32] tool %i ticks", GetTickCount() - tc);
}
[20:40:09] String1[512] tool 29 ticks
[20:40:09] String2[32] tool 28 ticks
Re: Clock 3D in game -
ragu1987 - 03.11.2013
Quote:
Originally Posted by IstuntmanI
This one is very bad scripted (see BigETI's post), I made a better version, doing the same thing but much more efficiently:
pawn Код:
/* +++++++ ++++++ +++ +++ ++ ++ +++ + ++ + + + + + + ++ ++++++ +++ +++ + + */
#include <a_samp>
new Text3D:giClock, giTime[ 3 ], gsString[ 128 ];
public OnFilterScriptInit() { giClock = Create3DTextLabel( " ", 0xFFFFFFFF, 895.0890, -1101.9412, 35.5424, 200.0, 0 );
SetTimer( "UpdateClock", 1000, true ); return 1; }
forward UpdateClock( ); public UpdateClock( ) { gettime( giTime[ 0 ], giTime[ 1 ], giTime[ 2 ] ); format( gsString, 128, "{00C0FF}Clock {FFAF00}By {F81414}Teddy\n{00C0FF}%02d{F300FF}:{FFAF00}%02d{F300FF}:{F81414}%02d", hours, minutes, seconds ); Update3DTextLabelText( giClock, 0xFFFFFFFF, gsString ); }
|
tried this showing some error please fix it and can we use this as filter script??
Error:
input(26) : error 17: undefined symbol "hours"
Error: The compiler failed. (no error code)