Post: C++ keyboard & for loop questions
02-17-2015, 08:25 PM #1
seanhellen
Are you high?
(adsbygoogle = window.adsbygoogle || []).push({}); Hi all - I just have a quick couple of c++ questions...

1. Is there a way of limiting the number of characters in the in-game keyboard. I have the function and it works fine for typewriter/iprintln text but I want to limit it to say 20 characters so it doesn't take over the screen...especially typewriter which takes an age to spell out Happy

2. I think I get for loops, but I have

    
Teleport::SpecifyPosition(0, 50, 50, 1030);
Teleport::SpecifyPosition(1, 50, 50, 1030);
Teleport::SpecifyPosition(2, 50, 50, 1030);
Teleport::SpecifyPosition(3, 50, 50, 1030);
Teleport::SpecifyPosition(4, 50, 50, 1030);
Teleport::SpecifyPosition(5, 50, 50, 1030);
Teleport::SpecifyPosition(6, 50, 50, 1030);
Teleport::SpecifyPosition(7, 50, 50, 1030);
Teleport::SpecifyPosition(8, 50, 50, 1030);
Teleport::SpecifyPosition(9, 50, 50, 1030);
Teleport::SpecifyPosition(10, 50, 50, 1030);
Teleport::SpecifyPosition(11, 50, 50, 1030);
Teleport::SpecifyPosition(12, 50, 50, 1030);
Teleport::SpecifyPosition(13, 50, 50, 1030);
Teleport::SpecifyPosition(14, 50, 50, 1030);
Teleport::SpecifyPosition(15, 50, 50, 1030);
Teleport::SpecifyPosition(16, 50, 50, 1030);
Teleport::SpecifyPosition(17, 50, 50, 1030);


which basically get everyone into the bunker I have made. It goes (client, x, y, z) so am I right in thinking that it could be simplified by;

    
for(int i = 0; i < 18; i++)
{
Teleport::SpecifyPosition(i, 50, 50, 1030)
}


3. If I have the above correct, I am really not sure how I can change this;

    
Models::SpecifySpawn(0, 0, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 30, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 60, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 90, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 120, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 150, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 180, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 210, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 240, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 270, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 300, 1000, "com_plasticcase_friendly");


This goes (x, y, z, Model) I know I can put multiple conditions in the for loop but have no idea how I would do this. I suppose it should be noted that;

-the x value goes from 0 - 550 in 50 increments
-the y value goes from 0 - 300 in 30 increments
-the z value stays the same

Or would it be easier to make a few for loops instead of trying to get them all into 1 big loop...

Any info would be great Smile
(adsbygoogle = window.adsbygoogle || []).push({});
02-27-2015, 08:42 PM #2
kiwi_modz
I defeated!
Originally posted by seanhellen View Post
Hi all - I just have a quick couple of c++ questions...

1. Is there a way of limiting the number of characters in the in-game keyboard. I have the function and it works fine for typewriter/iprintln text but I want to limit it to say 20 characters so it doesn't take over the screen...especially typewriter which takes an age to spell out Happy

2. I think I get for loops, but I have

    
Teleport::SpecifyPosition(0, 50, 50, 1030);
Teleport::SpecifyPosition(1, 50, 50, 1030);
Teleport::SpecifyPosition(2, 50, 50, 1030);
Teleport::SpecifyPosition(3, 50, 50, 1030);
Teleport::SpecifyPosition(4, 50, 50, 1030);
Teleport::SpecifyPosition(5, 50, 50, 1030);
Teleport::SpecifyPosition(6, 50, 50, 1030);
Teleport::SpecifyPosition(7, 50, 50, 1030);
Teleport::SpecifyPosition(8, 50, 50, 1030);
Teleport::SpecifyPosition(9, 50, 50, 1030);
Teleport::SpecifyPosition(10, 50, 50, 1030);
Teleport::SpecifyPosition(11, 50, 50, 1030);
Teleport::SpecifyPosition(12, 50, 50, 1030);
Teleport::SpecifyPosition(13, 50, 50, 1030);
Teleport::SpecifyPosition(14, 50, 50, 1030);
Teleport::SpecifyPosition(15, 50, 50, 1030);
Teleport::SpecifyPosition(16, 50, 50, 1030);
Teleport::SpecifyPosition(17, 50, 50, 1030);


which basically get everyone into the bunker I have made. It goes (client, x, y, z) so am I right in thinking that it could be simplified by;

    
for(int i = 0; i < 18; i++)
{
Teleport::SpecifyPosition(i, 50, 50, 1030)
}


3. If I have the above correct, I am really not sure how I can change this;

    
Models::SpecifySpawn(0, 0, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 30, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 60, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 90, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 120, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 150, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 180, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 210, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 240, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 270, 1000, "com_plasticcase_friendly");
Models::SpecifySpawn(0, 300, 1000, "com_plasticcase_friendly");


This goes (x, y, z, Model) I know I can put multiple conditions in the for loop but have no idea how I would do this. I suppose it should be noted that;

-the x value goes from 0 - 550 in 50 increments
-the y value goes from 0 - 300 in 30 increments
-the z value stays the same

Or would it be easier to make a few for loops instead of trying to get them all into 1 big loop...

Any info would be great Smile


char* KeyBoard(char* Title)
{
opd_s key = { 0x026F5BC, TOC };
void(*Run)(int, char*, char*, int, int, int) = (void(*)(int, char*, char*, int, int, int))&key;
Run(0, Title, "", 20, 0x72DCE8, 0x7239A0);
while (PS3::ReadInt32(0x73145C) != 0)
{
continue;
}
return PS3::ReadString(0x2380E22);
}

If i can remember correctly. Where you see the value 20 in this function, that is the limit of characters.

Correct me if i'm wrong.

The following user thanked kiwi_modz for this useful post:

seanhellen
02-27-2015, 11:13 PM #3
seanhellen
Are you high?
Great. Thanks for that kiwi Smile

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo