SergioBrasil

Filterscript Relogio em dcmd

Jul 28th, 2011
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.00 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #if defined FILETSCRIPT
  4.  
  5. #define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  6.  
  7.  
  8. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  9. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  10. {
  11.     if(IsPlayerConnected(playerid))
  12.     {
  13.     new Float:oldposx, Float:oldposy, Float:oldposz;
  14.     new Float:tempposx, Float:tempposy, Float:tempposz;
  15.     GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  16.     tempposx = (oldposx -x);
  17.     tempposy = (oldposy -y);
  18.     tempposz = (oldposz -z);
  19.     if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  20.     {
  21.     return true;
  22.     }
  23.     }
  24.     return false;
  25. }
  26.  
  27. public OnPlayerCommandText(playerid, cmdtext[])
  28. {
  29.     new String[256];
  30.     dcmd(relogio,7,cmdtext);
  31.     format(String, sizeof(String), "[Erro] o comando {FF0000} %s {0368E4} é Inválido!",cmdtext);
  32.     return SendClientMessage(playerid, 0xFF00FFFF, String);
  33. }
  34.  
  35.  
  36. dcmd_relogio(playerid, params[])
  37. {
  38. new listitems[] = "Relogio 1\nRelogio 2\nRelogio 3\nRelogio 4\nRelogio 5\nRelogio 6\nRelogio 7\nRelogio 8\nRelogio 9\nRelogio 10\nRelogio 11\nRelogio 12\nRelogio 13\nRelogio 14\nRelogio 15";
  39. if(PlayerToPoint(15.0,playerid,209.3934,-100.8104,1005.2578))
  40. {
  41. ShowPlayerDialog(playerid, 10103, DIALOG_STYLE_LIST,"Lojas BINCO, relogios",listitems,"Comprar", "Cancelar");
  42. return true;
  43. }
  44. }
  45.  
  46. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  47. {
  48. if(dialogid == 10103)
  49. {
  50.     if(!response) return SendClientMessage(playerid, COLOR_GRAD1,"Lojas BINCO: Compra cancelada.");
  51.     if(response)
  52.     {
  53.     if(listitem == 0)
  54.     {
  55.         if(GetPlayerMoney(playerid) > 10)
  56.         {
  57.             GivePlayerMoney(playerid, -10);
  58.             SetPlayerAttachedObject( playerid, 0, 19039, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  59.             return true;
  60.     }
  61.     }
  62.     if(listitem == 1)
  63.     {
  64.         if(GetPlayerMoney(playerid) > 10)
  65.         {
  66.         GivePlayerMoney(playerid, -10);
  67.         SetPlayerAttachedObject( playerid, 0, 19040, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  68.         return true;
  69.     }
  70.     }
  71.     if(listitem == 2)
  72.     {
  73.         if(GetPlayerMoney(playerid) > 10)
  74.         {
  75.         GivePlayerMoney(playerid, -10);
  76.         SetPlayerAttachedObject( playerid, 0, 19041, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  77.         return true;
  78.     }
  79.     }
  80.     if(listitem == 3)
  81.     {
  82.         if(GetPlayerMoney(playerid) > 10)
  83.         {
  84.         GivePlayerMoney(playerid, -10);
  85.         SetPlayerAttachedObject( playerid, 0, 19042, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  86.         return true;
  87.     }
  88.     }
  89.     if(listitem == 4)
  90.     {
  91.         if(GetPlayerMoney(playerid) > 10)
  92.         {
  93.         GivePlayerMoney(playerid, -10);
  94.         SetPlayerAttachedObject( playerid, 0, 19043, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  95.         return true;
  96.     }
  97.     }
  98.     if(listitem == 5)
  99.     {
  100.         if(GetPlayerMoney(playerid) > 10)
  101.         {
  102.         GivePlayerMoney(playerid, -10);
  103.         SetPlayerAttachedObject( playerid, 0, 19044, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  104.         return true;
  105.     }
  106.     }
  107.     if(listitem == 6)
  108.     {
  109.         if(GetPlayerMoney(playerid) > 10)
  110.         {
  111.         GivePlayerMoney(playerid, -10);
  112.         SetPlayerAttachedObject( playerid, 0, 19045, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  113.         return true;
  114.     }
  115.     }
  116.     if(listitem == 7)
  117.     {
  118.         if(GetPlayerMoney(playerid) > 10)
  119.         {
  120.         GivePlayerMoney(playerid, -10);
  121.         SetPlayerAttachedObject( playerid, 0, 19046, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  122.         return true;
  123.     }
  124.     }
  125.     if(listitem == 8)
  126.     {
  127.         if(GetPlayerMoney(playerid) > 10)
  128.         {
  129.         GivePlayerMoney(playerid, -10);
  130.         SetPlayerAttachedObject( playerid, 0, 19047, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  131.         return true;
  132.     }
  133.     }
  134.     if(listitem == 9)
  135.     {
  136.         if(GetPlayerMoney(playerid) > 10)
  137.         {
  138.         GivePlayerMoney(playerid, -10);
  139.         SetPlayerAttachedObject( playerid, 0, 19048, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  140.         return true;
  141.     }
  142.     }
  143.     if(listitem == 10)
  144.     {
  145.         if(GetPlayerMoney(playerid) > 10)
  146.         {
  147.         GivePlayerMoney(playerid, -10);
  148.         SetPlayerAttachedObject( playerid, 0, 19049, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  149.         return true;
  150.     }
  151.     }
  152.     if(listitem == 11)
  153.     {
  154.         if(GetPlayerMoney(playerid) > 10)
  155.         {
  156.         GivePlayerMoney(playerid, -10);
  157.         SetPlayerAttachedObject( playerid, 0, 19050, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  158.         return true;
  159.     }
  160.     }
  161.     if(listitem == 12)
  162.     {
  163.         if(GetPlayerMoney(playerid) > 10)
  164.         {
  165.         GivePlayerMoney(playerid, -10);
  166.         SetPlayerAttachedObject( playerid, 0, 19051, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  167.         return true;
  168.     }
  169.     }
  170.     if(listitem == 13)
  171.     {
  172.         if(GetPlayerMoney(playerid) > 10)
  173.         {
  174.         GivePlayerMoney(playerid, -10);
  175.         SetPlayerAttachedObject( playerid, 0, 19052, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  176.         return true;
  177.     }
  178.     }
  179.     if(listitem == 14)
  180.     {
  181.         if(GetPlayerMoney(playerid) > 10)
  182.         {
  183.         GivePlayerMoney(playerid, -10);
  184.         SetPlayerAttachedObject( playerid, 0, 19053, 5, 0.000000, -0.007722, -0.011143, 9.279358, 270.517852, 190.637268, 1.000000, 1.000000, 1.000000 );
  185.         return true;
  186.     }
  187.  }
  188. }
  189. }
  190. #endif
Advertisement
Add Comment
Please, Sign In to add comment