Guest User

Untitled

a guest
Jun 21st, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.85 KB | None | 0 0
  1. CMD:trunk(playerid, params[])
  2. {
  3.     SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /tputgun, /ttakegun, /tinfo");
  4.     return 1;
  5. }
  6. CMD:tinfo(playerid, params[])
  7. {
  8.     for(new v = 1; v < sizeof(CarInfo); v++)
  9.     {
  10.         new Float:vpx, Float:vpy, Float:vpz;
  11.         GetVehiclePos(v, vpx, vpy, vpz);
  12.         if(!IsPlayerInRangeOfPoint(playerid, 4, vpx, vpy, vpz)) continue;
  13.         if(vehilocked[v] == 1) return SendClientMessage(playerid, COLOR_RED, "This vehicle is locked!");
  14.         new str[64], str2[64], str3[64], str4[128];
  15.         new name[24];
  16.         new wepname1[24], wepname2[24], wepname3[24];
  17.         GetPlayerName(playerid, name, 24);
  18.         GetWeaponName(trunk[v][vwep1], wepname1, 24);
  19.         GetWeaponName(trunk[v][vwep2], wepname2, 24);
  20.         GetWeaponName(trunk[v][vwep3], wepname3, 24);
  21.         format(str, sizeof(str), "Slot 1: %s Ammo: %d", wepname1, trunk[v][vwep1a]);
  22.         format(str2, sizeof(str2), "Slot 2: %s Ammo: %d", wepname2, trunk[v][vwep2a]);
  23.         format(str3, sizeof(str3), "Slot 3: %s Ammo: %d", wepname3, trunk[v][vwep3a]);
  24.         format(str4, sizeof(str4), "*%s opens the trunk to check what's inside", name);
  25.         SendClientMessage(playerid, COLOR_ORANGE, "||===========|| TRUNK ||===========||");
  26.         SendClientMessage(playerid, COLOR_GREENISHGOLD, str);
  27.         SendClientMessage(playerid, COLOR_GREENISHGOLD, str2);
  28.         SendClientMessage(playerid, COLOR_GREENISHGOLD, str3);
  29.         ProxDetector(15.0, playerid, str4, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
  30.     }
  31.     return 1;
  32. }
  33.  
  34. CMD:tputgun(playerid, params[])
  35. {
  36.     for(new v = 1; v < sizeof(CarInfo); v++)
  37.     {
  38.         new Float:vpx, Float:vpy, Float:vpz;
  39.         GetVehiclePos(v, vpx, vpy, vpz);
  40.         if(!IsPlayerInRangeOfPoint(playerid, 4, vpx, vpy, vpz)) continue;
  41.         if(vehilocked[v] == 1) return SendClientMessage(playerid, COLOR_RED, "This vehicle is locked!");
  42.         new str[128];
  43.         new name[24];
  44.         GetPlayerName(playerid, name, 24);
  45.         new ammo = GetPlayerAmmo(playerid);
  46.         new weapon = GetPlayerWeapon(playerid);
  47.         new modelid = GetVehicleModel(v);
  48.         new m = GetVehicleModel(v);
  49.         if(modelid == 460 || modelid == 464 || modelid == 476 || modelid == 511 || modelid == 512 || modelid == 513 || modelid == 519 || modelid == 520 || modelid == 553 || modelid == 577 || modelid == 592 || modelid == 593) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
  50.         if(modelid == 448 || modelid == 461 || modelid == 462 || modelid == 463 || modelid == 468 || modelid == 471 || modelid == 481 || modelid == 509 || modelid == 510 || modelid == 521 || modelid == 522 || modelid == 523 || modelid == 581 || modelid == 586) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
  51.         if(modelid == 509 || modelid == 481 || modelid == 510) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
  52.         if(modelid == 430 || modelid == 446 || modelid == 452 || modelid == 453 || modelid == 454 || modelid == 472 || modelid == 473 || modelid == 484 || modelid == 493) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
  53.         if(m == 424 || m == 432 || m == 449 || m == 457 || m == 485 || m == 486 || m == 500 || m == 532 || m == 537 || m == 568 || m == 571 || m == 572 || m == 573 || m == 574 || m == 429 || m == 480 || m == 533 || m == 536 || m == 467 || m == 575) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
  54.         if(trunk[v][vwep1] == weapon || trunk[v][vwep1a] == 0)
  55.         {
  56.             new bullets;
  57.             new wepn[24];
  58.             GetWeaponName(weapon, wepn, 24);
  59.             if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
  60.             if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
  61.             if(bullets + trunk[v][vwep1a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
  62.             if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
  63.             trunk[v][vwep1] = weapon;
  64.             trunk[v][vwep1a] = trunk[v][vwep1a] + bullets;
  65.             GivePlayerWeapon(playerid, weapon, -bullets);
  66.             format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
  67.             ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
  68.         }
  69.         else if(trunk[v][vwep2] == weapon || trunk[v][vwep2a] == 0)
  70.         {
  71.             new bullets;
  72.             new wepn[24];
  73.             GetWeaponName(weapon, wepn, 24);
  74.             if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
  75.             if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
  76.             if(bullets + trunk[v][vwep2a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
  77.             if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
  78.             trunk[v][vwep2] = weapon;
  79.             trunk[v][vwep2a] = trunk[v][vwep2a] + bullets;
  80.             GivePlayerWeapon(playerid, weapon, -bullets);
  81.             format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
  82.             ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
  83.         }
  84.         else if(trunk[v][vwep3] == weapon || trunk[v][vwep3a] == 0)
  85.         {
  86.             new bullets;
  87.             new wepn[24];
  88.             GetWeaponName(weapon, wepn, 24);
  89.             if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
  90.             if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
  91.             if(bullets + trunk[v][vwep3a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
  92.             if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
  93.             trunk[v][vwep3] = weapon;
  94.             trunk[v][vwep3a] = trunk[v][vwep3a] + bullets;
  95.             GivePlayerWeapon(playerid, weapon, -bullets);
  96.             format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
  97.             ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
  98.         }
  99.         else return SendClientMessage(playerid, COLOR_GREY, "Trunk is full! Take some stuff out first!");
  100.     }
  101.     return 1;
  102. }
  103.  
  104. CMD:ttakegun(playerid, params[])
  105. {
  106.     for(new v = 1; v < sizeof(CarInfo); v++)
  107.     {
  108.         new Float:vpx, Float:vpy, Float:vpz;
  109.         GetVehiclePos(v, vpx, vpy, vpz);
  110.         if(!IsPlayerInRangeOfPoint(playerid, 4, vpx, vpy, vpz)) continue;
  111.         if(vehilocked[v] == 1) return SendClientMessage(playerid, COLOR_RED, "This vehicle is locked!");
  112.         new str[128];
  113.         new name[24];
  114.         GetPlayerName(playerid, name, 24);
  115.         new modelid = GetVehicleModel(v);
  116.         new m = GetVehicleModel(v);
  117.         if(modelid == 460 || modelid == 464 || modelid == 476 || modelid == 511 || modelid == 512 || modelid == 513 || modelid == 519 || modelid == 520 || modelid == 553 || modelid == 577 || modelid == 592 || modelid == 593) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
  118.         if(modelid == 448 || modelid == 461 || modelid == 462 || modelid == 463 || modelid == 468 || modelid == 471 || modelid == 481 || modelid == 509 || modelid == 510 || modelid == 521 || modelid == 522 || modelid == 523 || modelid == 581 || modelid == 586) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
  119.         if(modelid == 509 || modelid == 481 || modelid == 510) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
  120.         if(modelid == 430 || modelid == 446 || modelid == 452 || modelid == 453 || modelid == 454 || modelid == 472 || modelid == 473 || modelid == 484 || modelid == 493) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
  121.         if(m == 424 || m == 432 || m == 449 || m == 457 || m == 485 || m == 486 || m == 500 || m == 532 || m == 537 || m == 568 || m == 571 || m == 572 || m == 573 || m == 574 || m == 429 || m == 480 || m == 533 || m == 536 || m == 467 || m == 575) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
  122.         if(trunk[v][vwep1a] != 0)
  123.         {
  124.             new bullets;
  125.             new slot;
  126.             new wepn[24];
  127.             GetWeaponName(trunk[v][vwep1], wepn, 24);
  128.             if(sscanf(params, "ii", slot, bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ttakegun [Slot] [Ammo]");
  129.             if(bullets > trunk[v][vwep1a]) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo in the trunk!");
  130.             if(trunk[v][vwep1a] - bullets < 0) return SendClientMessage(playerid, COLOR_GREY, "The trunk does not have that much ammo!");
  131.             if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "You must take at least 1 ammo!");
  132.             trunk[v][vwep1a] = trunk[v][vwep1a] - bullets;
  133.             GivePlayerWeapon(playerid, trunk[v][vwep1], bullets);
  134.             format(str, sizeof(str), "%s takes a %s from the trunk", name, wepn);
  135.             ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
  136.         }
  137.         else if(trunk[v][vwep2a] != 0)
  138.         {
  139.             new bullets;
  140.             new slot;
  141.             new wepn[24];
  142.             GetWeaponName(trunk[v][vwep2], wepn, 24);
  143.             if(sscanf(params, "ii", slot, bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ttakegun [Slot] [Ammo]");
  144.             if(bullets > trunk[v][vwep2a]) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo in the trunk!");
  145.             if(trunk[v][vwep2a] - bullets < 0) return SendClientMessage(playerid, COLOR_GREY, "The trunk does not have that much ammo!");
  146.             if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "You must take at least 1 ammo!");
  147.             trunk[v][vwep2a] = trunk[v][vwep2a] - bullets;
  148.             GivePlayerWeapon(playerid, trunk[v][vwep2], bullets);
  149.             format(str, sizeof(str), "%s takes a %s from the trunk", name, wepn);
  150.             ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
  151.         }
  152.         else if(trunk[v][vwep3a] != 0)
  153.         {
  154.             new bullets;
  155.             new slot;
  156.             new wepn[24];
  157.             GetWeaponName(trunk[v][vwep3], wepn, 24);
  158.             if(sscanf(params, "ii", slot, bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ttakegun [Slot] [Ammo]");
  159.             if(bullets > trunk[v][vwep3a]) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo in the trunk!");
  160.             if(trunk[v][vwep3a] - bullets < 0) return SendClientMessage(playerid, COLOR_GREY, "The trunk does not have that much ammo!");
  161.             if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "You must take at least 1 ammo!");
  162.             trunk[v][vwep3a] = trunk[v][vwep3a] - bullets;
  163.             GivePlayerWeapon(playerid, trunk[v][vwep3], bullets);
  164.             format(str, sizeof(str), "%s takes a %s from the trunk", name, wepn);
  165.             ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
  166.         }
  167.         else return SendClientMessage(playerid, COLOR_GREY, "Trunk is empty!");
  168.     }
  169.     return 1;
  170. }
Add Comment
Please, Sign In to add comment