new "type function" works but... Please help

Non-platform specific questions.

new "type function" works but... Please help

Postby Hblade » Thu Mar 11, 2010 6:47 pm

Hey. I broke down the code so you dont have to read a buncha stuff, but okay... This is my commands:

Code: Select all
void Type(const char *message, ...)
{
    sprintf(text, message);
}

Now when you do this:
Type("Message, %d", x);

or even another variable, it works but... the numbers always come up to this:
26265352

Any ideas on how to fix this?
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: new "type function" works but... Please help

Postby Bee-Ant » Fri Mar 12, 2010 12:33 am

Function :
Code: Select all
void Type(char A[256])
{
    sprintf(actor.text,A);
}


Usage :
Code: Select all
Type("any text you want here");
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: new "type function" works but... Please help

Postby Hblade » Fri Mar 12, 2010 2:35 pm

Not what I ment, bee :3 How would you be able to implament the same functionality as the "sprintf" command? In other words, the " ... " in the code works but when ever ANY variable is displayed, it displays the numbers " 26265352 ". I have fixed this but it limits the ammounts of variable numbers you can display. So in other words, if you do this:

" Type("X Position: %d", x); "
x will say " 26265352 ". No matter what. Even if you make a new variable. I think the reason is is because of the fact that it automatically displays the maximum ammount of text characters in that string. But I dont know of any methods to work this out.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: new "type function" works but... Please help

Postby Bee-Ant » Fri Mar 12, 2010 3:40 pm

Oh...
I have never done this before.
Why dont you use regular sprintf?
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: new "type function" works but... Please help

Postby Hblade » Sun Mar 14, 2010 4:21 am

Because I plan to have it type out :D
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron