Guest User

Untitled

a guest
Dec 7th, 2012
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1.  
  2. struct CallbackAMX
  3. {
  4. bool PublicFound;
  5. cell AMX_address;
  6. cell * AMX_physical;
  7. int POINTER;
  8. CallbackAMX()
  9. {
  10. PublicFound = false;
  11. AMX_address = NULL;
  12. AMX_physical = NULL;
  13. POINTER = 0;
  14. }
  15. };
  16.  
  17. struct Callbacks
  18. {
  19. CallbackAMX ClosestNodeIDChange;
  20. CallbackAMX GPSRouteCalculated;
  21. };
  22.  
  23. std::map <AMX*, Callbacks> rcp_amxinfo;
  24.  
  25. PLUGIN_EXPORT int PLUGIN_CALL AmxLoad( AMX *amx )
  26. {
  27. Callbacks temp;
  28. if (!amx_FindPublic(amx, "OnPlayerClosestNodeIDChange", &temp.ClosestNodeIDChange.POINTER))
  29. {
  30. temp.ClosestNodeIDChange.PublicFound = true;
  31. }
  32. if (!amx_FindPublic(amx, "GPS_WhenRouteIsCalculated", &temp.GPSRouteCalculated.POINTER))
  33. {
  34. temp.GPSRouteCalculated.PublicFound = true;
  35. }
  36. rcp_amxinfo.insert(std::pair<AMX*,Callbacks>(amx,temp));
  37. return amx_Register( amx, Natives::AMXNatives, -1 );
  38. }
Advertisement
Add Comment
Please, Sign In to add comment