Advertisement
Guest User

/me és /do script

a guest
Dec 25th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.94 KB | None | 0 0
  1. ///------includeok-------///
  2. #include <a_samp>
  3. #include <zcmd>
  4. ///------Szin defineok------///
  5. #define Szurke 0xAFAFAFAA
  6. #define Lila 0xC2A2DAAA
  7.  
  8. ///---------Előre funkció--------////
  9. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  10. ///---------/me parancs-----------///
  11. CMD:me(playerid, params[])
  12. {
  13.     if(isnull(params)) return SendClientMessage(playerid, Szurke, "[HASZNÁLAT] /me [cselekvés]");
  14.     new string[128];
  15.     format(string, sizeof(string), "*(Cselekvés) %s %s", GetPlayerNameEx(playerid), params);
  16.     ProxDetector(30.0, playerid, string, Lila,Lila,Lila,Lila,Lila);
  17.     return 1;
  18. }
  19. ///----------/do parancs----------///
  20. CMD:do(playerid, params[])
  21. {
  22.     if(isnull(params)) return SendClientMessage(playerid, Szurke, "[HASZNÁLAT] /do [történés]");
  23.     new string[128];
  24.     format(string, sizeof(string), "*(Történés) %s (( %s ))", params, GetPlayerNameEx(playerid));
  25.     ProxDetector(30.0, playerid, string, Lila,Lila,Lila,Lila,Lila);
  26.     return 1;
  27. }
  28. ///---------ProxDetector---------///
  29. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  30. {
  31.     if(IsPlayerConnected(playerid))
  32. {
  33.     new Float:posx, Float:posy, Float:posz;
  34.     new Float:oldposx, Float:oldposy, Float:oldposz;
  35.     new Float:tempposx, Float:tempposy, Float:tempposz;
  36.     GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  37.     for(new i = 0; i < MAX_PLAYERS; i++)
  38. {
  39.     if(IsPlayerConnected(i) && (GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i)))
  40. {
  41.     GetPlayerPos(i, posx, posy, posz);
  42.     tempposx = (oldposx -posx);
  43.     tempposy = (oldposy -posy);
  44.     tempposz = (oldposz -posz);
  45.     if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  46. {
  47.     SendClientMessage(i, col1, string);
  48. }
  49.     else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  50. {
  51.     SendClientMessage(i, col2, string);
  52. }
  53.     else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  54. {
  55.     SendClientMessage(i, col3, string);
  56. }
  57.     else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  58. {
  59.     SendClientMessage(i, col4, string);
  60. }
  61.     else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  62. {
  63.     SendClientMessage(i, col5, string);
  64. }
  65. }
  66.     else
  67. {
  68.     SendClientMessage(i, col1, string);
  69. }
  70. }
  71. }
  72.     return 1;
  73. }
  74. ///--------GetPlayerNameEx----------///
  75. stock GetPlayerNameEx(playerid)
  76. {
  77.      new jatekosnev[25];
  78.      GetPlayerName(playerid, jatekosnev, sizeof(jatekosnev));
  79.      return jatekosnev;
  80. }
  81. ///---------Vége---------///
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement