Some Questions
#1

My Questions for now are

in a TextDraw, how do i locate the X,Y of my screen? as in what co-ordinates are the right cornor for example...
how do i locate the coords?

2. I cant figure out how to make a timer for example 5:00 counting to 0:00 and at 0:00 people get out of DM for example, can someone help me?
Reply
#2

Quote:
Originally Posted by wiki
Note: The x,y coordinate is the top left coordinate for the text draw area based on a 640x480 "canvas"
The top right corner would be around 620x and 10y.

I'd recommend using Zhamorat's textdraw creator.
Reply
#3

pawn Код:
SetTimer("DMEnd", 5*60*1000, false); //5*60*1000 = 5 minutes
pawn Код:
forward DMEnd();
public DMEnd()
{
    //do ya thang
}
Reply
#4

Quote:
Originally Posted by LarzI
Посмотреть сообщение
pawn Код:
SetTimer("DMEnd", 5*60*1000, false); //5*60*1000 = 5 minutes
pawn Код:
forward DMEnd();
public DMEnd()
{
    //do ya thang
}
yea, i knew this but how to make it like a textdraw or gamemodetext?
counting from 5:00 to 0:00..

edit:
where to get this textdraw creater.. ******d it nothing found
sa-mp search nothing found..

second edit: found the person, its not zhamorat but zamaroht and gonna search the tool.
Reply
#5

Run a 1 second timer, and loop it for 5 minutes. Everytime it get's called, hide, setstring and show textdraw.
Reply
#6

kk, can u show me small example please? xD
i never worked with textdraws/timers much and i need it now...
maybe a tutorial link aswell?
Reply
#7

I don't know if there are any tutorials, you should search.
I will not show you how to make a textdraw, as there is alot of tutorials on that subject.

Here's an example of what you want (hopefully)

[pawn]//this is the variable we'll use to store the time
new
gSeconds = 59,
gMinutes = 4,
gTextdrawTimer;
pawn Код:
//where you want the countdown to start:
TextDrawSetString( myTextdraw, "5:00" );
TextDrawShowForAll( myTextdraw );
gTextdrawTimer = SetTimer( "TextdrawTimer", 1000, true );
Then there's the tricky part:
pawn Код:
forward TextdrawTimer();
public TextdrawTimer()
{
    if(( gMinutes && gSeconds ) == 0 )
    {
        KillTimer( gTextdrawTimer );
        DMEnd();
    }
    new
        string[ 4 ];
    if( gSeconds < 0 )
        gSeconds--;
    else
    {
        gSeconds = 59;
        gMinutes--;
    }
    format( string, sizeof( string ), "%i:%i", gMinutes, gSeconds );
    TextDrawHideForAll( myTextdraw );
    TextDrawSetString( myTextdraw, string );
    TextDrawShowForAll( myTextdraw );
}
Then make your DMEnd function:

pawn Код:
DMEnd()
{
    //do ya thang
}
I think that should work.
Tell me if you want me to explain what I do.
Reply
#8

Textdraws do not have to be reshown when TextDrawSetString is being used.
Reply
#9

I haven't used textdraws is a while, but I know that atleast in 0.2, you had to hide before setting string, then reshow, else it would bug up.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)