Advertisement
fakuivan

Untitled

Nov 28th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. #include <sourcemod>
  2.  
  3. #pragma semicolon 1
  4. #pragma newdecls required
  5.  
  6. public Plugin myinfo = {
  7. name = "",
  8. author = "",
  9. description = "",
  10. version = "0.0.0",
  11. url = ""
  12. };
  13.  
  14. public void OnPluginStart()
  15. {
  16. PrintToServer("Hello, World!");
  17. OperateIndirictly(Add, 1, 2);
  18. }
  19.  
  20. typedef OperateInts = function int (int i_a, int i_b);
  21.  
  22. int Add(int i_a, int i_b)
  23. {
  24. return i_a + i_b;
  25. }
  26.  
  27. int OperateIndirictly(OperateInts func, int i_a, int i_b)
  28. {
  29. return func(i_a, i_b);
  30. }
  31.  
  32. For some reason this throws that:
  33.  
  34. SourceMod AMX Mod X
  35. Light Dark
  36. Full Screen
  37. SourcePawn Compiler 1.9.0.5921
  38. Copyright (c) 1997-2006 ITB CompuPhase
  39. Copyright (c) 2004-2015 AlliedModders LLC
  40.  
  41. plugin.sp(17) : error 100: function prototypes do not match
  42. plugin.sp(29) : error 012: invalid function call, not a valid address
  43. plugin.sp(29) : warning 215: expression has no effect
  44. plugin.sp(29) : warning 215: expression has no effect
  45. plugin.sp(29) : error 001: expected token: ";", but found ")"
  46. plugin.sp(29) : error 029: invalid expression, assumed zero
  47. plugin.sp(29) : fatal error 190: too many error messages on one line
  48.  
  49. Compilation aborted.
  50. 5 Errors.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement