03.06.2017, 07:43
Hey guys, I have self made function to which I parse values stored in global variable, but I have problem. I'm calling this function from two different places as following:
PHP код:
//Inside OnDialogResponse
MDC_LookUp(playerid, MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_METHOD], inputtext);
//OnPlayerClickTD (refresh button)
MDC_LookUp(playerid, MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_METHOD], MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_INPUT]);
//And that's start of my function
MDC_LookUp(playerid, method, input[], bool:error = false)
{
MDC_g_sPlayer[playerid][E_MDC_LOOK_UP_METHOD] = 1337;
printf("Variable value %i", method);
//other code
}
//After first call method parameter prints correct number (according to one parsed in OnResponse func call), but on second call changing global variable's value changes also local method value as it print's 1337 and I don't understand why.