dynamic_call-test.pwn 696 B

12345678910111213141516171819202122232425262728293031
  1. #include <a_samp>
  2. #include "..\dynamic_call"
  3. forward test(i, &j, s[], t[]);
  4. main() {
  5. new x = 456;
  6. print("public - method #1");
  7. CallFunction(GetPublicAddressFromName("test"), 123, ref(x), ref("hell"), ref("yeah"));
  8. print("public - method #2");
  9. Push(123);
  10. Push(ref(x));
  11. Push(ref("hell"));
  12. Push(ref("yeah"));
  13. Call(GetPublicAddressFromName("test"));
  14. // print("native - method #1");
  15. // CallNativeByAddress(GetNativeAddressFromName("printf"), ref("Hello, %s!"), ref("World"));
  16. // print("native - method #2");
  17. // Push(ref("Hello, %s!"));
  18. // Push(ref("World"));
  19. // SysreqD(GetNativeAddressFromName("printf"));
  20. }
  21. public test(i, &j, s[], t[]) {
  22. printf("test: %d %d %s %s", i, j, s, t);
  23. }