View difference between Paste ID: t43mEKmd and zgbjaQY1
SHOW: | | - or go back to the newest paste.
1
//need convert this:
2-
struct CallbackAMX
2+
3-
{
3+
	void OnPlayerClosestNodeIDChange(int playerid, int oldnode, int newnode)
4-
	bool PublicFound;
4+
5-
	cell AMX_address;
5+
		for (std::list<AMX *>::iterator a = rcp_amx_list.begin(); a != rcp_amx_list.end(); ++a)
6-
	cell * AMX_physical;
6+
		{
7-
	int POINTER;
7+
			if (!amx_FindPublic(* a, "OnPlayerClosestNodeIDChange", &GlobOnUpdateIndex))
8-
	CallbackAMX()
8+
			{
9
				amx_Push(* a, newnode);
10-
		PublicFound = false;
10+
				amx_Push(* a, oldnode);
11-
		AMX_address = NULL;
11+
				amx_Push(* a, playerid);
12-
		AMX_physical = NULL;
12+
				amx_Exec(* a, NULL, GlobOnUpdateIndex);
13-
		POINTER = 0;
13+
			}
14
		}
15-
};
15+
16
17-
struct Callbacks
17+
//to this:
18-
{
18+
	void OnPlayerClosestNodeIDChange(int playerid, int oldnode, int newnode)
19-
	CallbackAMX ClosestNodeIDChange;
19+
20-
	CallbackAMX GPSRouteCalculated;
20+
		for (std::map<AMX *,Callbacks>::iterator a = rcp_amxinfo.begin(); a != rcp_amxinfo.end(); ++a)
21-
};
21+
		{
22
//what should I do now to get Callbacks.something.something?
23-
std::map			<AMX*, Callbacks>			rcp_amxinfo;
23+
			if (!amx_FindPublic(*a, "OnPlayerClosestNodeIDChange", &GlobOnUpdateIndex))
24
			{
25-
PLUGIN_EXPORT int PLUGIN_CALL AmxLoad( AMX *amx ) 
25+
				amx_Push(* a, newnode);
26-
{
26+
				amx_Push(* a, oldnode);
27-
	Callbacks temp;
27+
				amx_Push(* a, playerid);
28-
	if (!amx_FindPublic(amx, "OnPlayerClosestNodeIDChange", &temp.ClosestNodeIDChange.POINTER))
28+
				amx_Exec(* a, NULL, GlobOnUpdateIndex);
29
			}
30-
		temp.ClosestNodeIDChange.PublicFound = true;
30+
		}
31
	}