Jump to content

Comands Handle


Go to solution Solved by lTz,

Recommended Posts

Hi , i'm kinda new here and i want to ask something

i have something like this in client source

boll test = true;
if(test){
	do stuf
else{
	do other stuff
	}
}

now the problem that i don't know how to do and pls don't make fun of me 🙂
i want a button in  a window to acces this bool and based on the toggle  of that button to select an if
ty for help:P

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

  • Solution

Edit : i manage to do it after some research
what i did was something like this:
 

public:
	bool test;
	void SetTest(bool value) {test = value;}

PyObject* miniMapSetChose(PyObject* poSelf, PyObject* poArgs)
{
    bool bValue;
    if (!PyTuple_GetBoolean(poArgs, 0, &bValue))
        return Py_BuildException();

    CPythonCharacterManager::Instance().SetChose(bValue);
	Tracef("SetChose: %s", bValue ? "True" : "False");

    return Py_BuildNone();
}
{ "SetChose", 				miniMapSetChose, 						METH_VARARGS },


TraceF("code chose")
if (test){
	do stuff
	TraceF("true")
	}
else{
	do other sutff
	TraceF("false")
	}	
}
TraceF("looping rest of code")



rest of code logic

and in client i call it like miniMap.SetChose(False) or True

now i have another problem

whatever i chose True or False the code is working with the true value the traceback  only show true
and after some other edits i manage to make it so that is show true or false whatever i chose but when this happen the rest of the code is no longer working the traceback is not showing looping rest of code

If anyone know a fix or go around

Ty 🙂

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.