Created
December 26, 2018 18:20
-
-
Save codenulls/51a16a244f05da5e9e02d166542fbfec to your computer and use it in GitHub Desktop.
Function for getting all task names for MTA SA.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bool CClientGame::GetLocalPlayerTaskNames(SString& strConcatenatedTaskNames, bool bPrimary) | |
{ | |
CClientPed* pLocalPlayer = static_cast<CClientPed*>(GetLocalPlayer()); | |
if (pLocalPlayer) | |
{ | |
int cTaskTypes = bPrimary ? 5 : 6; | |
for (int iTaskType = 0; iTaskType < cTaskTypes; iTaskType++) | |
{ | |
std::vector<SString> taskHierarchy; | |
if (CStaticFunctionDefinitions::GetPedTask(*pLocalPlayer, bPrimary, iTaskType, taskHierarchy)) | |
{ | |
strConcatenatedTaskNames += "\n" + taskHierarchy[0]; | |
for (uint i = 0; i < taskHierarchy.size(); i++) | |
{ | |
if (i > 0) | |
{ | |
strConcatenatedTaskNames += "->" + taskHierarchy[i]; | |
} | |
} | |
} | |
} | |
} | |
else | |
{ | |
return false; | |
} | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment