ALERT!
Click here to register with a few steps and explore all our cool stuff we have to offer!
Home
Upgrade
Credits
Help
Search
Awards
Achievements
 1651

CHAR LOOP?

by EMILG0NZA - 06-15-2020 - 10:17 PM
#1
Some days ago i try to made a CharLoop But Not A CharBool That u need to Press A and u active a Bool And then u Use the stuff
Something Like 

{"Off", "RPG Ammo", "Idk Lol"}

Something like that can someone help me out ur opinion can be the trsure of me :)
Disc = 0xemiil
Reply
#2
(06-15-2020 - 10:17 PM)FeetForFree Wrote: Some days ago i try to made a CharLoop But Not A CharBool That u need to Press A and u active a Bool And then u Use the stuff
Something Like 

{"Off", "RPG Ammo", "Idk Lol"}

Something like that can someone help me out ur opinion can be the trsure of me :)

Do you want to do something like that?

OFF
[Image: vXB7oPS.png]

ON
[Image: cwllc2q.png]
[Image: a8keeuutawx01.gif]
Reply
#3
(06-16-2020 - 03:10 AM)iLLuminder Wrote:
(06-15-2020 - 10:17 PM)FeetForFree Wrote: Some days ago i try to made a CharLoop But Not A CharBool That u need to Press A and u active a Bool And then u Use the stuff
Something Like 

{"Off", "RPG Ammo", "Idk Lol"}

Something like that can someone help me out ur opinion can be the trsure of me :)

Do you want to do something like that?

OFF
[Image: vXB7oPS.png]

ON
[Image: cwllc2q.png]
No bro thats a CharBool 

like Theres no On/Off Just U change The Var and u turn Off with a char option like "Off"
Disc = 0xemiil
Reply
#4
(06-16-2020 - 03:41 AM)FeetForFree Wrote:
(06-16-2020 - 03:10 AM)iLLuminder Wrote:
(06-15-2020 - 10:17 PM)FeetForFree Wrote: Some days ago i try to made a CharLoop But Not A CharBool That u need to Press A and u active a Bool And then u Use the stuff
Something Like 

{"Off", "RPG Ammo", "Idk Lol"}

Something like that can someone help me out ur opinion can be the trsure of me :)

Do you want to do something like that?

OFF
[Image: vXB7oPS.png]

ON
[Image: cwllc2q.png]
No bro thats a CharBool 

like Theres no On/Off Just U change The Var and u turn Off with a char option like "Off"

If you use strcmp? This is what you want?

Code:
char* tog[] = { "ON" ,"OFF" };

if (strcmp(NameVar[*var], "ON"))
{
//Turn ON
}
else
{
//Turn Off
}
[Image: a8keeuutawx01.gif]
Reply
#5
(06-16-2020 - 04:34 AM)iLLuminder Wrote:
(06-16-2020 - 03:41 AM)FeetForFree Wrote:
(06-16-2020 - 03:10 AM)iLLuminder Wrote:
(06-15-2020 - 10:17 PM)FeetForFree Wrote: Some days ago i try to made a CharLoop But Not A CharBool That u need to Press A and u active a Bool And then u Use the stuff
Something Like 

{"Off", "RPG Ammo", "Idk Lol"}

Something like that can someone help me out ur opinion can be the trsure of me :)

Do you want to do something like that?

OFF
[Image: vXB7oPS.png]

ON
[Image: cwllc2q.png]
No bro thats a CharBool 

like Theres no On/Off Just U change The Var and u turn Off with a char option like "Off"

If you use strcmp? This is what you want?

Code:
char* tog[] = { "ON" ,"OFF" };

if (strcmp(NameVar[*var], "ON"))
{
//Turn ON
}
else
{
//Turn Off
}
Ye u have the Idea i will see if with more Var and test THX
Disc = 0xemiil
Reply
#6
(06-16-2020 - 05:05 AM)FeetForFree Wrote:
(06-16-2020 - 04:34 AM)iLLuminder Wrote:
(06-16-2020 - 03:41 AM)FeetForFree Wrote:
(06-16-2020 - 03:10 AM)iLLuminder Wrote:
(06-15-2020 - 10:17 PM)FeetForFree Wrote: Some days ago i try to made a CharLoop But Not A CharBool That u need to Press A and u active a Bool And then u Use the stuff
Something Like 

{"Off", "RPG Ammo", "Idk Lol"}

Something like that can someone help me out ur opinion can be the trsure of me :)

Do you want to do something like that?

OFF
[Image: vXB7oPS.png]

ON
[Image: cwllc2q.png]
No bro thats a CharBool 

like Theres no On/Off Just U change The Var and u turn Off with a char option like "Off"

If you use strcmp? This is what you want?

Code:
char* tog[] = { "ON" ,"OFF" };

if (strcmp(NameVar[*var], "ON"))
{
//Turn ON
}
else
{
//Turn Off
}
Ye u have the Idea i will see if with more Var and test THX

You can try something like this:

Code:
char buf[255];

char* tog[] = { "OFF", "ON" };

int togg = 0;

void AddBool(char* option, bool b00l, char** NameVar, int* var, int min, int max, char* info)
{
addOption(option);

snprintf(buf, sizeof(buf), "%s", NameVar[*var]);

Right_Text(buf);

if (strcmp(NameVar[*var], "ON"))
{
b00l = true;
}
else
{
b00l = false;
}
}
[Image: a8keeuutawx01.gif]
Reply
#7
what are you trying to do with this exactly I might be able to help if I now what you are using it for
Reply
#8
(06-19-2020 - 06:03 AM)Venom_Modz Wrote: what are you trying to do with this exactly I might be able to help if I now what you are using it for
Just like Active Loops withaut using a Bool 

Using [What i have in mind ] int and that int active loops

To use a char instead a bool Like { "OFF" "Rocket Louncher"} etc
Disc = 0xemiil
Reply
#9
(06-19-2020 - 08:15 PM)Unbound Wrote:
Code:
template<typename A, typename B>
bool AddEditorOption(bool ExecOnArrowPress, CONST PCHAR Spec, A ToDisplay, B* Value, B Min, B Max, B Accuracy, CONST PCHAR Format, ...) {
bool ReturnValue = false;
CHAR Buf[128];
va_list Args;
va_start(Args, Format);
vsprintf(Buf, Format, Args);
va_end(Args);
CHAR Editor[128];
sprintf_s(Editor, Spec, ToDisplay);
MenuContextOptionCount++;
if (MenuContextCurrentOption <= MenuContextMaxOptions && MenuContextOptionCount <= MenuContextMaxOptions) {
DrawText(Buf, MenuBannerPosX - (MenuBannerSizeX / 2.0f) + MenuTextPadding, MenuBannerPosY + (MenuBannerSizeY / 2.0f) + (MenuIncrement / 2.0f) + (MenuContextOptionCount * MenuIncrement) - MenuTextOffset, (MenuContextCurrentOption == MenuContextOptionCount) ? MenuSelectedOptionTextColour : MenuOptionTextColour, false, false, false);
DrawText(Editor, MenuBannerPosX + (MenuBannerSizeX / 2.0f) - ((MenuContextCurrentOption == MenuContextOptionCount) ? (MenuTextPadding * 4.5f) : MenuTextPadding), MenuBannerPosY + (MenuBannerSizeY / 2.0f) + (MenuIncrement / 2.0f) + (MenuContextOptionCount * MenuIncrement) - MenuTextOffset, (MenuContextCurrentOption == MenuContextOptionCount) ? MenuSelectedOptionTextColour : MenuOptionTextColour, false, true, false);
if (MenuContextCurrentOption == MenuContextOptionCount) {
DrawSprite("commonmenu", "arrowright", MenuBannerPosX + (MenuBannerSizeX / 2.0f) - (MenuTextPadding * 2.0f), MenuBannerPosY + (MenuBannerSizeY / 2.0f) + (MenuIncrement / 2.0f) + (MenuContextOptionCount * MenuIncrement), 0.0f, MenuVariableArrowColour);
DrawSprite("commonmenu", "arrowleft", MenuBannerPosX + (MenuBannerSizeX / 2.0f) - (MenuTextPadding * 3.5f), MenuBannerPosY + (MenuBannerSizeY / 2.0f) + (MenuIncrement / 2.0f) + (MenuContextOptionCount * MenuIncrement), 0.0f, MenuVariableArrowColour);
}
}
else if ((MenuContextOptionCount > (MenuContextCurrentOption - MenuContextMaxOptions)) && MenuContextOptionCount <= MenuContextCurrentOption) {
DrawText(Buf, MenuBannerPosX - (MenuBannerSizeX / 2.0f) + MenuTextPadding, MenuBannerPosY + (MenuBannerSizeY / 2.0f) + (MenuIncrement / 2.0f) + ((MenuContextOptionCount - (MenuContextCurrentOption - MenuContextMaxOptions)) * MenuIncrement) - MenuTextOffset, (MenuContextCurrentOption == MenuContextOptionCount) ? MenuSelectedOptionTextColour : MenuOptionTextColour, false, false, false);
DrawText(Editor, MenuBannerPosX + (MenuBannerSizeX / 2.0f) - ((MenuContextCurrentOption == MenuContextOptionCount) ? (MenuTextPadding * 4.5f) : MenuTextPadding), MenuBannerPosY + (MenuBannerSizeY / 2.0f) + (MenuIncrement / 2.0f) + ((MenuContextOptionCount - (MenuContextCurrentOption - MenuContextMaxOptions)) * MenuIncrement) - MenuTextOffset, (MenuContextCurrentOption == MenuContextOptionCount) ? MenuSelectedOptionTextColour : MenuOptionTextColour, false, true, false);
if (MenuContextCurrentOption == MenuContextOptionCount) {
DrawSprite("commonmenu", "arrowright", MenuBannerPosX + (MenuBannerSizeX / 2.0f) - (MenuTextPadding * 2.0f), MenuBannerPosY + (MenuBannerSizeY / 2.0f) + (MenuIncrement / 2.0f) + ((MenuContextOptionCount - (MenuContextCurrentOption - MenuContextMaxOptions)) * MenuIncrement), 0.0f, MenuVariableArrowColour);
DrawSprite("commonmenu", "arrowleft", MenuBannerPosX + (MenuBannerSizeX / 2.0f) - (MenuTextPadding * 3.5f), MenuBannerPosY + (MenuBannerSizeY / 2.0f) + (MenuIncrement / 2.0f) + ((MenuContextOptionCount - (MenuContextCurrentOption - MenuContextMaxOptions)) * MenuIncrement), 0.0f, MenuVariableArrowColour);
}
}
if (MenuContextCurrentOption == MenuContextOptionCount) {
if (OptionLeftPressed) {
*Value -= Accuracy;
if (*Value < Min)
*Value = Max;
ExecOnArrowPress ? ReturnValue = true : ReturnValue = false;
}
if (OptionRightPressed) {
*Value += Accuracy;
if (*Value > Max)
*Value = Min;
ExecOnArrowPress ? ReturnValue = true : ReturnValue = false;
}
if (OptionSelectPressed) {
ExecOnArrowPress ? ReturnValue = false : ReturnValue = true;
}
}
return ReturnValue;
}
Nice I will try out
Disc = 0xemiil
Reply

Users browsing: 5 Guest(s)