Advertisement
Guest User

Untitled

a guest
Mar 5th, 2011
279
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <a_samp>
  2.  
  3. //____DEFINE____//
  4.  
  5. #define M4 31
  6. #define AK47 30
  7. #define MP5 29
  8. #define SHOTGUN 25
  9. #define DESERT 24
  10. #define S-PISTOL 23
  11.  
  12. #define rosso 0xAA3333AA
  13. #define bianco 0xFFFFFFAA
  14.  
  15. //____NEW____//
  16.  
  17. new mess[128];
  18. new ammom4[MAX_PLAYERS];
  19. new ammoak47[MAX_PLAYERS];
  20. new ammomp5[MAX_PLAYERS];
  21. new ammoshot[MAX_PLAYERS];
  22. new ammodesert[MAX_PLAYERS];
  23. new ammopistol [MAX_PLAYERS];
  24.  
  25. //____BOOL____//
  26.  
  27. new bool: usom4[MAX_PLAYERS];
  28. new bool: usoak47[MAX_PLAYERS];
  29. new bool: usomp5[MAX_PLAYERS];
  30. new bool: usoshot[MAX_PLAYERS];
  31. new bool: usodesert[MAX_PLAYERS];
  32. new bool: usopistol[MAX_PLAYERS];
  33.  
  34. public OnFilterScriptInit()
  35. {
  36.     print("\n--------------------------------------");
  37.     print(" FilterScript Attach Weapon by Mitosking LOADED");
  38.     print("--------------------------------------\n");
  39.     return 1;
  40. }
  41.  
  42. public OnFilterScriptExit()
  43. {
  44.     print("\n--------------------------------------");
  45.     print(" FilterScript Attach Weapon by Mitosking UNLOADED");
  46.     print("--------------------------------------\n");
  47.     return 1;
  48. }
  49.  
  50. public OnPlayerConnect(playerid)
  51. {
  52.     RemovePlayerAttachedObject(playerid, 0);
  53.     RemovePlayerAttachedObject(playerid, 1);
  54.     usom4[playerid] = false;
  55.     usoak47[playerid] = false;
  56.     usomp5[playerid] = false;
  57.     usopistol[playerid] = false;
  58.     usoshot[playerid] = false;
  59.     ammom4[playerid] = 0;
  60.     ammoak47[playerid] = 0;
  61.     ammomp5[playerid] = 0;
  62.     ammopistol[playerid] = 0;
  63.     ammoshot[playerid] = 0;
  64.     return 1;
  65. }
  66.  
  67. public OnPlayerDisconnect(playerid, reason)
  68. {
  69.     RemovePlayerAttachedObject(playerid, 0);
  70.     RemovePlayerAttachedObject(playerid, 1);
  71.     usom4[playerid] = false;
  72.     usoak47[playerid] = false;
  73.     usomp5[playerid] = false;
  74.     usopistol[playerid] = false;
  75.     usoshot[playerid] = false;
  76.     ammom4[playerid] = 0;
  77.     ammoak47[playerid] = 0;
  78.     ammomp5[playerid] = 0;
  79.     ammopistol[playerid] = 0;
  80.     ammoshot[playerid] = 0;
  81.     return 1;
  82. }
  83.  
  84. public OnPlayerSpawn(playerid)
  85. {
  86.     RemovePlayerAttachedObject(playerid, 0);
  87.     RemovePlayerAttachedObject(playerid, 1);
  88.     usom4[playerid] = false;
  89.     usoak47[playerid] = false;
  90.     usomp5[playerid] = false;
  91.     usopistol[playerid] = false;
  92.     usoshot[playerid] = false;
  93.     ammom4[playerid] = 0;
  94.     ammoak47[playerid] = 0;
  95.     ammomp5[playerid] = 0;
  96.     ammopistol[playerid] = 0;
  97.     ammoshot[playerid] = 0;
  98.     return 1;
  99. }
  100.  
  101. public OnPlayerCommandText(playerid, cmdtext[])
  102. {
  103.     if(!strcmp("/tracolla", cmdtext, true))
  104.     {
  105.         if(GetPlayerWeapon(playerid) == M4)
  106.         {
  107.         if(IsPlayerAttachedObjectSlotUsed(playerid, 0)) return SendClientMessage(playerid, rosso, "Hai già un'arma a tracolla.");
  108.         ammom4[playerid] = GetPlayerAmmo(playerid);
  109.         SetPlayerAttachedObject(playerid, 0, 356, 1, -0.022362, -0.152069, -0.057422, 0.000000, 29.934783, 0.000000, 1.000000, 1.000000, 1.000000);
  110.         format(mess, 128, "Hai messo un M4 con %d ammo a tracolla", ammom4[playerid]);
  111.         SendClientMessage(playerid, bianco, mess);
  112.         usom4[playerid] = true;
  113.         SetPlayerAmmo(playerid, M4, 0);
  114.         }
  115.         else if(GetPlayerWeapon(playerid) == AK47)
  116.         {
  117.         if(IsPlayerAttachedObjectSlotUsed(playerid, 0)) return SendClientMessage(playerid, rosso, "Hai già un'arma a tracolla.");
  118.         ammoak47[playerid] = GetPlayerAmmo(playerid);
  119.         SetPlayerAttachedObject(playerid, 0, 355, 1, -0.065233, -0.141876, 0.000000, 354.843688, 33.616905, 0.000000, 1.000000, 1.000000, 1.000000);
  120.         format(mess, 128, "Hai messo un Ak47 con %d ammo a tracolla", ammom4[playerid]);
  121.         SendClientMessage(playerid, bianco, mess);
  122.         usoak47[playerid] = true;
  123.         SetPlayerAmmo(playerid, AK47, 0);
  124.         }
  125.         else if(GetPlayerWeapon(playerid) == MP5)
  126.         {
  127.         if(IsPlayerAttachedObjectSlotUsed(playerid, 0)) return SendClientMessage(playerid, rosso, "Hai già un'arma a tracolla.");
  128.         ammomp5[playerid] = GetPlayerAmmo(playerid);
  129.         SetPlayerAttachedObject(playerid, 0, 353, 1, 0.000000, -0.154720, -0.024471, 0.000000, 38.219757, 0.000000, 1.000000, 1.000000, 1.000000);
  130.         format(mess, 128, "Hai messo un Mp5 con %d ammo a tracolla", ammom4[playerid]);
  131.         SendClientMessage(playerid, bianco, mess);
  132.         usomp5[playerid] = true;
  133.         SetPlayerAmmo(playerid, MP5, 0);
  134.         }
  135.         else if(GetPlayerWeapon(playerid) == SHOTGUN)
  136.         {
  137.         if(IsPlayerAttachedObjectSlotUsed(playerid, 0)) return SendClientMessage(playerid, rosso, "Hai già un'arma a tracolla.");
  138.         ammoshot[playerid] = GetPlayerAmmo(playerid);
  139.         SetPlayerAttachedObject(playerid, 0, 349, 1, -0.188727, -0.164754, 0.017699, 0.000000, 32.359973, 0.000000, -49.034614, 1.000000, 1.000000);
  140.         format(mess, 128, "Hai messo uno ShotGun con %d ammo a tracolla", ammoshot[playerid]);
  141.         SendClientMessage(playerid, bianco, mess);
  142.         usoshot[playerid] = true;
  143.         SetPlayerAmmo(playerid, SHOTGUN, 0);
  144.         }
  145.         else return SendClientMessage(playerid, rosso, "Non hai nessun'arma da mettere a tracolla.");
  146.         return 1;
  147.     }
  148.    
  149.     if(!strcmp("/riponi", cmdtext, true))
  150.     {
  151.         if(GetPlayerWeapon(playerid) == DESERT)
  152.         {
  153.         if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) return SendClientMessage(playerid, rosso, "Hai già un'arma nella fondina.");
  154.         ammodesert[playerid] = GetPlayerAmmo(playerid);
  155.         SetPlayerAttachedObject(playerid, 1, 348, 8, -0.059862, -0.057768, 0.112505, 260.384887, 0.000000, 359.132019, 1.000000, 1.000000, 1.000000);
  156.         format(mess, 128, "Hai messo una Desert Eagle con %d ammo nella fondina", ammodesert[playerid]);
  157.         SendClientMessage(playerid, bianco, mess);
  158.         usodesert[playerid] = true;
  159.         SetPlayerAmmo(playerid, DESERT, 0);
  160.         }
  161.         else if(GetPlayerWeapon(playerid) == S-PISTOL)
  162.         {
  163.         if(IsPlayerAttachedObjectSlotUsed(playerid, 1)) return SendClientMessage(playerid, rosso, "Hai già un'arma nella fondina.");
  164.         ammopistol[playerid] = GetPlayerAmmo(playerid);
  165.         SetPlayerAttachedObject(playerid, 1, 347, 8, -0.046527, -0.039525, 0.111312, 275.118041, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000);
  166.         format(mess, 128, "Hai messo una Pistola Silenziata con %d ammo nella fondina", ammopistol[playerid]);
  167.         SendClientMessage(playerid, bianco, mess);
  168.         usopistol[playerid] = true;
  169.         SetPlayerAmmo(playerid, S-PISTOL, 0);
  170.         }
  171.         else SendClientMessage(playerid, rosso, "Nessun'arma da mettere in fondina");
  172.         return 1;
  173.     }
  174.    
  175.     if(!strcmp("/estrae", cmdtext, true))
  176.     {
  177.         if(!IsPlayerAttachedObjectSlotUsed(playerid, 0)) return SendClientMessage(playerid, rosso, "Non hai armi a tracolla.");
  178.         if(usom4[playerid] == true)
  179.         {
  180.         RemovePlayerAttachedObject(playerid, 0);
  181.         GivePlayerWeapon(playerid, M4, ammom4[playerid]);
  182.         SendClientMessage(playerid, bianco, "Hai preso il tuo M4");
  183.         usom4[playerid] = false;
  184.         }
  185.         else if(usoak47[playerid] == true)
  186.         {
  187.         RemovePlayerAttachedObject(playerid, 0);
  188.         GivePlayerWeapon(playerid, AK47, ammom4[playerid]);
  189.         SendClientMessage(playerid, bianco, "Hai preso il tuo Ak47");
  190.         usoak47[playerid] = false;
  191.         }
  192.         else if(usomp5[playerid] == true)
  193.         {
  194.         RemovePlayerAttachedObject(playerid, 0);
  195.         GivePlayerWeapon(playerid, MP5, ammomp5[playerid]);
  196.         SendClientMessage(playerid, bianco, "Hai preso il tuo Mp5");
  197.         usomp5[playerid] = false;
  198.         }
  199.         else if(usoshot[playerid] == true)
  200.         {
  201.         RemovePlayerAttachedObject(playerid, 0);
  202.         GivePlayerWeapon(playerid, SHOTGUN, ammoshot[playerid]);
  203.         SendClientMessage(playerid, bianco, "Hai preso il tuo ShotGun");
  204.         usoshot[playerid] = false;
  205.         }
  206.         return 1;
  207.     }
  208.    
  209.     if(!strcmp("/fondina", cmdtext, true))
  210.     {
  211.         if(!IsPlayerAttachedObjectSlotUsed(playerid, 1)) return SendClientMessage(playerid, rosso, "Non hai armi nella fondina.");
  212.         if(usodesert[playerid] == true)
  213.         {
  214.         RemovePlayerAttachedObject(playerid, 1);
  215.         GivePlayerWeapon(playerid, DESERT, ammodesert[playerid]);
  216.         SendClientMessage(playerid, bianco, "Hai preso la tua Desert Eagle");
  217.         usodesert[playerid] = false;
  218.         }
  219.         else if(usopistol[playerid] == true)
  220.         {
  221.         RemovePlayerAttachedObject(playerid, 1);
  222.         GivePlayerWeapon(playerid, S-PISTOL, ammopistol[playerid]);
  223.         SendClientMessage(playerid, bianco, "Hai preso la tua Pistola Silenziata");
  224.         usopistol[playerid] = false;
  225.         }
  226.         return 1;
  227.     }
  228.     return 0;
  229. }
Advertisement
RAW Paste Data Copied
Advertisement