Burgershot
  • Home
  • Members
  • Team
  • Help
  • Search
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search
Burgershot SA-MP Pawn Scripting [Pawn] HELP! How to use #emit and while? Basic to do with the function?

 
  • 0 Vote(s) - 0 Average
Pawn HELP! How to use #emit and while? Basic to do with the function?
PutuSuhartawan
Offline

Burgershot Member
Posts: 120
Threads: 52
Joined: Nov 2020
Reputation: 1
Location: Indonesia
#1
2021-05-24, 11:03 PM (This post was last modified: 2021-05-28, 02:54 AM by PutuSuhartawan.)
Code:
stock SendClientMessageEx(playerid, color, const text[], {Float, _}:...)
{
  static
      args,
      str[144];

  /*
    *  Custom function that uses #emit to format variables into a string.
    *  This code is very fragile; touching any code here will cause crashing!
  */
  if ((args = numargs()) == 3)
  {
      SendClientMessage(playerid, color, text);
  }
  else
  {
    while (--args >= 3)
    {
      #emit LCTRL 5
      #emit LOAD.alt args
      #emit SHL.C.alt 2
      #emit ADD.C 12
      #emit ADD
      #emit LOAD.I
      #emit PUSH.pri
    }
    #emit PUSH.S text
    #emit PUSH.C 144
    #emit PUSH.C str
    #emit PUSH.S 8
    #emit SYSREQ.C format
    #emit LCTRL 5
    #emit SCTRL 4

    SendClientMessage(playerid, color, str);

    #emit RETN
  }
  return 1;
}


Sir i don't know what does means in this function? i need to translate to learn what is meaning of this code.
Kwarde
Offline

Burgershot Member
Posts: 99
Threads: 2
Joined: Sep 2020
Reputation: 8
Location: The Netherlands
#2
2021-05-25, 06:51 PM
https://github.com/YashasSamaga/AMX-Assembly-Docs/blob/master/DOCUMENT.md
Y_Less
Offline

Administrator

Posts: 323
Threads: 16
Joined: Feb 2019
Reputation: 90
#3
2021-05-28, 12:37 AM (This post was last modified: 2021-05-28, 12:38 AM by Y_Less.)
Don't. You make about 10 topics per day on incredibly simple things. While there's nothing wrong with that per-se, it does mean you are several years off even thinking about `#emit`. There is nothing you can't do in normal code that you should be trying to do.
« Next Oldest | Next Newest »



  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Burgershot - Powered by our Community and MyBB Original Theme by Emerald

Linear Mode
Threaded Mode