Making variables universal
#1

I have an include file, where a certain value is stored in an array. When I set the value from a particular filterscript, for example setting the value from filterscript A to 23. Whatever function from that filterscript wants the variable from that include file is correct. But if I want to get this variable from another filterscript which also includes this file, it gives me a whole new variable. The variables of the SAME file does not match when called to get or set from different files. How do I make it so that if the variable of that file is set to 23 from filterscript A, I will get 23 when I check the value from filterscript B? My code:

Include File:

Код:
forward GetInformation(playerid, info[]);
forward SetInformation(playerid, info[], value);

new BankMoney[MAX_PLAYERS];


public GetInformation(playerid, info[]){
	if(strcmp(info, "TheBankMoney", true) == 0) return BankMoney[playerid];
}

public SetInformation(playerid, info[], value){
	if(strcmp(info, "TheBankMoney", true) == 0) 
	{ BankMoney[playerid] = value; }
}
Function called::

Код:
GetInformation(playerid, "TheBankMoney")
SetInformation(playerid, "TheBankMoney", 42);
Reply


Messages In This Thread
Making variables universal - by Brandlax - 02.11.2012, 06:51
Re: Making variables universal - by cessil - 02.11.2012, 07:12
Re: Making variables universal - by Brandlax - 02.11.2012, 07:22

Forum Jump:


Users browsing this thread: 1 Guest(s)