Advertisement
Guest User

Untitled

a guest
Dec 19th, 2010
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 14.44 KB | None | 0 0
  1.     if(strcmp(cmd, "/cofano", true) == 0)
  2.     {
  3.         if(IsPlayerConnected(playerid))
  4.         {
  5.             new x_nr[256];
  6.             x_nr = strtok(cmdtext, idx);
  7.             if(!strlen(x_nr))
  8.             {
  9.                 SendClientMessage(playerid, COLOR_WHITE, "USA: /cofano [oggetto]");
  10.                 SendClientMessage(playerid, COLOR_WHITE, "Oggetti: info, mettiarma, prendiarma, mettiarmatura, prendiarmatura");
  11.                 return 1;
  12.             }
  13.             if(strcmp(x_nr,"apri",true) == 0)
  14.             {
  15.                 new counter = 0;
  16.                 new result;
  17.                 new plyName[MAX_PLAYER_NAME];
  18.                
  19.                 GetPlayerName(playerid,plyName,MAX_PLAYER_NAME);
  20.                 for(new i; i != MAX_VEHICLES; i++)
  21.                 {
  22.                     new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
  23.                     if(dist)
  24.                     {
  25.                         result = i;
  26.                         counter++;
  27.                     }
  28.                 }
  29.                 switch(counter)
  30.                 {
  31.                     case 0:
  32.                     {
  33.                         SendClientMessage(playerid,COLOR_GREY, "   Nessuna macchina con il cofano ti è vicina");
  34.                     }
  35.                     case 1:
  36.                     {
  37.                         if(IsPlayerInAnyVehicle(playerid))
  38.                         {
  39.                             SendClientMessage(playerid, COLOR_GREY, "   Non puoi aprire il cofano da dentro la macchina");
  40.                         }
  41.                         if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner]) && strcmp(plyName, VehicleInfo3[result][vOwner]))
  42.                         {
  43.                             SendClientMessage(playerid, COLOR_GREY, "  Questo non è il tuo veicolo!");
  44.                             return 1;
  45.                         }
  46.                         if(cofano[result] == 0)
  47.                         SetVehicleParamsEx(result,engine,lights,alarm,doors,VEHICLE_PARAMS_ON,boot,objective);
  48.                         cofano[result] = 1;
  49.                         PlayerActionMessage(15.0,playerid,"apre il cofano del suo veicolo");
  50.                         }
  51.                         else
  52.                         {
  53.                         SendClientMessage(playerid, COLOR_GREY, "   Il cofano del veicolo è chiuso");
  54.                     }
  55.                     default:
  56.                     {
  57.                         SendClientMessage(playerid, COLOR_GREY, "   Ci sono più macchine vicino a te,allontanati");
  58.                     }
  59.                 }
  60.             return 1;
  61.             }
  62.             else if(strcmp(x_nr,"info",true) == 0)
  63.             {
  64.                 new counter = 0;
  65.                 new result;
  66.                 new plyName[MAX_PLAYER_NAME];
  67.  
  68.                 GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
  69.                 for(new i; i != MAX_VEHICLES; i++)
  70.                 {
  71.                     new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
  72.                     if(dist)
  73.                     {
  74.                         result = i;
  75.                         counter++;
  76.                     }
  77.                 }
  78.                 switch(counter)
  79.                 {
  80.                     case 0:
  81.                     {
  82.                         SendClientMessage(playerid, COLOR_GREY, "   Nessuna macchina con il cofano ti è vicina");
  83.                     }
  84.  
  85.                     case 1:
  86.                     {
  87.                         if(IsPlayerInAnyVehicle(playerid))
  88.                         {
  89.                             SendClientMessage(playerid, COLOR_GREY, "  Non puoi aprire il cofano da dentro la macchina");
  90.                             return 1;
  91.                         }
  92.                         if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner]) && strcmp(plyName, VehicleInfo3[result][vOwner]))
  93.                         {
  94.                             SendClientMessage(playerid, COLOR_GREY, "  Questo non è il tuo veicolo!");
  95.                             return 1;
  96.                         }
  97.  
  98.                         SendClientMessage(playerid, COLOR_LIGHTBLUE, "|_______ Cofano _______|");
  99.                         for(new slot = 1; slot != MAX_TRUNK_SLOTS; slot++)
  100.                         {
  101.                             new gunname[100];
  102.                             if(vehTrunk[result][slot] != 0)
  103.                             {
  104.                                 GetWeaponName(vehTrunk[result][slot], gunname, sizeof(gunname));
  105.                                 format(string, sizeof(string), "| Slot %i: %s (Ammo: %i)", slot, gunname, vehTrunkAmmo[result][slot]);
  106.                                 SendClientMessage(playerid, COLOR_WHITE, string);
  107.                             }
  108.                             else
  109.                             {
  110.                                 format(string, sizeof(string), "| Slot %i: Vuoto (Ammo: N/A)", slot);
  111.                                 SendClientMessage(playerid, COLOR_WHITE, string);
  112.                             }
  113.                         }
  114.                         format(string, sizeof(string), "| Body armour: %f%", vehTrunkArmour[result]);
  115.                         SendClientMessage(playerid, COLOR_WHITE, string);
  116.  
  117.                         GetPlayerName(playerid, sendername, sizeof(sendername));
  118.                         format(string, sizeof(string), "* %s apre il suo cofano.", sendername);
  119.                         ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  120.                         return 1;
  121.                     }
  122.  
  123.                     default:
  124.                     {
  125.                         SendClientMessage(playerid, COLOR_GREY, "   Ci sono più auto vicino a te, allontanati.");
  126.                         return 1;
  127.                     }
  128.                 }
  129.                 return 1;
  130.             }
  131.             else if(strcmp(x_nr,"mettiarma",true) == 0)
  132.             {
  133.                 new counter = 0;
  134.                 new result;
  135.                 new plyName[MAX_PLAYER_NAME];
  136.  
  137.                 GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
  138.                 for(new i; i != MAX_VEHICLES; i++)
  139.                 {
  140.                     new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
  141.                     if(dist)
  142.                     {
  143.                         result = i;
  144.                         counter++;
  145.                     }
  146.                 }
  147.                 switch(counter)
  148.                 {
  149.                     case 0:
  150.                     {
  151.                         SendClientMessage(playerid, COLOR_GREY, "   Nessuna macchina con il cofano ti è vicina");
  152.                     }
  153.  
  154.                     case 1:
  155.                     {
  156.                         if(vehTrunkCounter[result] != (MAX_TRUNK_SLOTS-1))
  157.                         {
  158.                         if(IsPlayerInAnyVehicle(playerid))
  159.                         {
  160.                             SendClientMessage(playerid, COLOR_GREY, "  Non puoi aprire il cofano da dentro la macchina");
  161.                             return 1;
  162.                         }
  163.                         if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner])&& strcmp(plyName, VehicleInfo3[result][vOwner]))
  164.                         {
  165.                             SendClientMessage(playerid, COLOR_GREY, "  Questo non è il tuo veicolo!");
  166.                             return 1;
  167.                         }
  168.                             new buffer[512];
  169.                             new gunname[100];
  170.                             new gunID = GetPlayerWeapon(playerid);
  171.                             new gunAmmo = GetPlayerAmmo(playerid);
  172.  
  173.                             if(gunID != 0 && gunAmmo != 0)
  174.                             {
  175.                                 GetWeaponName(gunID, gunname, sizeof(gunname));
  176.                                 vehTrunkCounter[result]++;
  177.                                 vehTrunk[result][vehTrunkCounter[result]] = gunID;
  178.                                 vehTrunkAmmo[result][vehTrunkCounter[result]] = gunAmmo;
  179.                                 format(buffer, sizeof(buffer), "Hai messo il tuo %s (Ammo: %i) nel cofano della tua auto.", gunname, gunAmmo);
  180.                                 SendClientMessage(playerid, COLOR_WHITE, buffer);
  181.                                 RemovePlayerWeapon(playerid, gunID);
  182.                                 GetPlayerName(playerid, sendername, sizeof(sendername));
  183.                                 format(string, sizeof(string), "* %s apre il bagagliaio e ci mette dentro l'arma.", sendername);
  184.                                 ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  185.                                 return 1;
  186.                             }
  187.                         }
  188.                         else
  189.                         {
  190.                             SendClientMessage(playerid, COLOR_GREY, " Nel tuo cofano non c'entra più niente.");
  191.                             return 1;
  192.                         }
  193.                     }
  194.  
  195.                     default:
  196.                     {
  197.                         SendClientMessage(playerid, COLOR_GREY, "   Ci sono più auto vicino a te, allontanati.");
  198.                         return 1;
  199.                     }
  200.                 }
  201.                 return 1;
  202.             }
  203.             else if(strcmp(x_nr,"prendiarma",true) == 0)
  204.             {
  205.                 new counter = 0;
  206.                 new result;
  207.                 new plyName[MAX_PLAYER_NAME];
  208.  
  209.                 GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
  210.                 for(new i; i != MAX_VEHICLES; i++)
  211.                 {
  212.                     new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
  213.                     if(dist)
  214.                     {
  215.                         result = i;
  216.                         counter++;
  217.                     }
  218.                 }
  219.  
  220.                 switch(counter)
  221.                 {
  222.                     case 0:
  223.                     {
  224.                         SendClientMessage(playerid, COLOR_GREY, "   Nessuna macchina con il cofano ti è vicina");
  225.                         return 1;
  226.                     }
  227.  
  228.                     case 1:
  229.                     {
  230.                         if(IsPlayerInAnyVehicle(playerid))
  231.                         {
  232.                             SendClientMessage(playerid, COLOR_GREY, "  Non puoi aprire il cofano da dentro la macchina");
  233.                             return 1;
  234.                         }
  235.                         if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner])&& strcmp(plyName, VehicleInfo3[result][vOwner]))
  236.                         {
  237.                             SendClientMessage(playerid, COLOR_GREY, "  Questo non è il tuo veicolo!");
  238.                             return 1;
  239.                         }
  240.                         if(vehTrunkCounter[result] != 0)
  241.                         {
  242.                             new buffer[512];
  243.                             new gunName[100];
  244.                             GivePlayerWeapon(playerid, vehTrunk[result][vehTrunkCounter[result]], vehTrunkAmmo[result][vehTrunkCounter[result]]);
  245.                             GetWeaponName(vehTrunk[result][vehTrunkCounter[result]], gunName, sizeof(gunName));
  246.                             format(buffer, sizeof(buffer), "Hai preso il tuo %s (Ammo: %i) dal tuo cofano.", gunName, vehTrunkAmmo[result][vehTrunkCounter[result]]);
  247.                             SendClientMessage(playerid, COLOR_WHITE, buffer);
  248.                             vehTrunk[result][vehTrunkCounter[result]] = '\0';
  249.                             vehTrunkAmmo[result][vehTrunkCounter[result]] = '\0';
  250.                             vehTrunkCounter[result]--;
  251.                             GetPlayerName(playerid, sendername, sizeof(sendername));
  252.                             format(string, sizeof(string), "* %s apre il cofano e prende le sue armi.", sendername);
  253.                             ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  254.                             return 1;
  255.                         }
  256.                         else
  257.                         {
  258.                             SendClientMessage(playerid, COLOR_GREY, "   Cofano pieno ! ");
  259.                             return 1;
  260.                         }
  261.                     }
  262.  
  263.                     default:
  264.                     {
  265.                         SendClientMessage(playerid, COLOR_GREY, "   Ci sono più auto vicino a te, allontanati!");
  266.                         return 1;
  267.                     }
  268.                 }
  269.                 return 1;
  270.             }
  271.             else if(strcmp(x_nr,"mettiarmatura",true) == 0)
  272.             {
  273.                 new counter = 0;
  274.                 new result;
  275.                 new plyName[MAX_PLAYER_NAME];
  276.  
  277.                 GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
  278.                 for(new i; i != MAX_VEHICLES; i++)
  279.                 {
  280.                     new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
  281.                     if(dist)
  282.                     {
  283.                         result = i;
  284.                         counter++;
  285.                     }
  286.                 }
  287.                 switch(counter)
  288.                 {
  289.                     case 0:
  290.                     {
  291.                         SendClientMessage(playerid, COLOR_GREY, "   Nessuna macchina con il cofano ti è vicina");
  292.                         return 1;
  293.                     }
  294.  
  295.                     case 1:
  296.                     {
  297.                         if(IsPlayerInAnyVehicle(playerid))
  298.                         {
  299.                             SendClientMessage(playerid, COLOR_GREY, "  Non puoi aprire il cofano da dentro la macchina");
  300.                             return 1;
  301.                         }
  302.                         if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner])&& strcmp(plyName, VehicleInfo3[result][vOwner]))
  303.                         {
  304.                             SendClientMessage(playerid, COLOR_GREY, "  Questo non è il tuo veicolo!");
  305.                             return 1;
  306.                         }
  307.  
  308.                         new Float:plyArmour;
  309.                         GetPlayerArmour(playerid, plyArmour);
  310.  
  311.                         if(plyArmour != 0)
  312.                         {
  313.                             SetPlayerArmour(playerid, 0);
  314.                             vehTrunkArmour[result] = plyArmour;
  315.  
  316.                             GetPlayerName(playerid, sendername, sizeof(sendername));
  317.                             format(string, sizeof(string), "* %s mette il suo bodyarmour nel cofano.", sendername);
  318.                             ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  319.                             return 1;
  320.                         }
  321.                         else
  322.                         {
  323.                             SendClientMessage(playerid, COLOR_GREY, "   Non hai un BodyArmour nel cofano. ");
  324.                             return 1;
  325.                         }
  326.                     }
  327.  
  328.                     default:
  329.                     {
  330.                         SendClientMessage(playerid, COLOR_GREY, "   Ci sono più auto vicino a te, allontanati.");
  331.                         return 1;
  332.                     }
  333.                 }
  334.                 return 1;
  335.             }
  336.             else if(strcmp(x_nr,"prendiarmatura",true) == 0)
  337.             {
  338.                 new counter = 0;
  339.                 new result;
  340.                 new plyName[MAX_PLAYER_NAME];
  341.  
  342.                 GetPlayerName(playerid, plyName, MAX_PLAYER_NAME);
  343.                 for(new i; i != MAX_VEHICLES; i++)
  344.                 {
  345.                     new dist = CheckPlayerDistanceToVehicle(3.5, playerid, i);
  346.                     if(dist)
  347.                     {
  348.                         result = i;
  349.                         counter++;
  350.                     }
  351.                 }
  352.                 switch(counter)
  353.                 {
  354.                     case 0:
  355.                     {
  356.                         SendClientMessage(playerid, COLOR_GREY, "   Nessuna macchina con il cofano ti è vicina");
  357.                         return 1;
  358.                     }
  359.  
  360.                     case 1:
  361.                     {
  362.                         if(IsPlayerInAnyVehicle(playerid))
  363.                         {
  364.                             SendClientMessage(playerid, COLOR_GREY, "  Non puoi aprire il cofano da dentro la macchina");
  365.                             return 1;
  366.                         }
  367.                         if (strcmp(plyName, VehicleInfo[result][vOwner]) && strcmp(plyName, VehicleInfo2[result][vOwner])&& strcmp(plyName, VehicleInfo3[result][vOwner]))
  368.                         {
  369.                             SendClientMessage(playerid, COLOR_GREY, "  Questo non è il tuo veicolo!");
  370.                             return 1;
  371.                         }
  372.                         if(vehTrunkArmour[result] != 0)
  373.                         {
  374.                             SetPlayerArmour(playerid, vehTrunkArmour[result]);
  375.                             vehTrunkArmour[result] = 0;
  376.  
  377.                             GetPlayerName(playerid, sendername, sizeof(sendername));
  378.                             format(string, sizeof(string), "* %s prende il suo bodyarmoru dal cofano e se lo mette.", sendername);
  379.                             ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  380.                             return 1;
  381.                         }
  382.                         else
  383.                         {
  384.                             SendClientMessage(playerid, COLOR_GREY, "   Non ci sono bodyarmour nel cofano ! ");
  385.                             return 1;
  386.                         }
  387.                     }
  388.  
  389.                     default:
  390.                     {
  391.                         SendClientMessage(playerid, COLOR_GREY, "   Ci sono più auto vicino a te, allontanati.");
  392.                         return 1;
  393.                     }
  394.                 }
  395.                 return 1;
  396.             }
  397.         }
  398.         return 1;
  399.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement