Advertisement
ipsBruno

(Pawn) (Ainda não terminei) Global Goto's

Sep 29th, 2013
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.27 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #define MAX_GOTO 1000
  4.  
  5. stock const oncallback [ MAX_GOTO ] ;
  6.  
  7. #define goto<%0> \
  8.                 global_step(#%0)
  9.  
  10. #define glabel:%1<%0> \
  11.                 globalLabel(#%1,%0)
  12.  
  13. #pragma dynamic 65335
  14.  
  15. bruno2(); public bruno2() {
  16.  
  17.         goto<volver>;
  18.         return 1;
  19.  
  20. }
  21.  
  22. bruno(a[]); public bruno(a[]) {
  23.  
  24.         print("1");
  25.        
  26.         glabel:bruno<"volver">;
  27.        
  28.         print("2");
  29.  
  30.         print("3");
  31.        
  32.         print("4");
  33.         print("5");
  34. }
  35.  
  36.  
  37. main()
  38. {
  39.  
  40.     SetTimer("bruno", 1000, false);
  41.     SetTimer("bruno2", 2000, false);
  42. }
  43.  
  44.  
  45. stock globalLabel(publica[], name[]) {
  46.    
  47.     static bah, beh, pIndex;
  48.  
  49.     pIndex = funcidx(publica);
  50.  
  51.     #emit LCTRL       1
  52.     #emit NEG
  53.     #emit ADD.C       32
  54.     #emit STOR.pri  bah
  55.     #emit LREF.alt  bah
  56.  
  57.     #emit LCTRL 1
  58.     #emit NEG
  59.     #emit ADD
  60.     #emit LOAD.alt  pIndex
  61.     #emit SHL.C.alt   3
  62.     #emit ADD
  63.     #emit STOR.pri  bah
  64.     #emit LREF.pri  bah
  65.     #emit STOR.pri  bah
  66.  
  67.     #emit LCTRL       6
  68.     #emit STOR.PRI  beh
  69.  
  70.     setproperty(.id = 0, .name = name, .value = bah);
  71.     setproperty(.id = 1, .name = name, .value = beh);
  72.  
  73.     return true;
  74. }
  75.  
  76. stock global_step(label[])
  77. {
  78.     new bah = getproperty(0,label);
  79.     new beh = getproperty(1,label);
  80.  
  81.     #emit LCTRL      6
  82.     #emit PUSH.C 0
  83.     #emit LOAD.S.pri bah
  84.     #emit SCTRL      6
  85.    
  86.     return true;
  87.  
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement