Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:trunk(playerid, params[])
- {
- SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /tputgun, /ttakegun, /tinfo");
- return 1;
- }
- CMD:tinfo(playerid, params[])
- {
- for(new v = 1; v < sizeof(CarInfo); v++)
- {
- new Float:vpx, Float:vpy, Float:vpz;
- GetVehiclePos(v, vpx, vpy, vpz);
- if(!IsPlayerInRangeOfPoint(playerid, 4, vpx, vpy, vpz)) continue;
- if(vehilocked[v] == 1) return SendClientMessage(playerid, COLOR_RED, "This vehicle is locked!");
- new str[64], str2[64], str3[64], str4[128];
- new name[24];
- new wepname1[24], wepname2[24], wepname3[24];
- GetPlayerName(playerid, name, 24);
- GetWeaponName(trunk[v][vwep1], wepname1, 24);
- GetWeaponName(trunk[v][vwep2], wepname2, 24);
- GetWeaponName(trunk[v][vwep3], wepname3, 24);
- format(str, sizeof(str), "Slot 1: %s Ammo: %d", wepname1, trunk[v][vwep1a]);
- format(str2, sizeof(str2), "Slot 2: %s Ammo: %d", wepname2, trunk[v][vwep2a]);
- format(str3, sizeof(str3), "Slot 3: %s Ammo: %d", wepname3, trunk[v][vwep3a]);
- format(str4, sizeof(str4), "*%s opens the trunk to check what's inside", name);
- SendClientMessage(playerid, COLOR_ORANGE, "||===========|| TRUNK ||===========||");
- SendClientMessage(playerid, COLOR_GREENISHGOLD, str);
- SendClientMessage(playerid, COLOR_GREENISHGOLD, str2);
- SendClientMessage(playerid, COLOR_GREENISHGOLD, str3);
- ProxDetector(15.0, playerid, str4, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
- }
- return 1;
- }
- CMD:tputgun(playerid, params[])
- {
- for(new v = 1; v < sizeof(CarInfo); v++)
- {
- new Float:vpx, Float:vpy, Float:vpz;
- GetVehiclePos(v, vpx, vpy, vpz);
- if(!IsPlayerInRangeOfPoint(playerid, 4, vpx, vpy, vpz)) continue;
- if(vehilocked[v] == 1) return SendClientMessage(playerid, COLOR_RED, "This vehicle is locked!");
- new str[128];
- new name[24];
- GetPlayerName(playerid, name, 24);
- new ammo = GetPlayerAmmo(playerid);
- new weapon = GetPlayerWeapon(playerid);
- new modelid = GetVehicleModel(v);
- new m = GetVehicleModel(v);
- 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!");
- 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!");
- if(modelid == 509 || modelid == 481 || modelid == 510) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
- 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!");
- 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!");
- if(trunk[v][vwep1] == weapon || trunk[v][vwep1a] == 0)
- {
- new bullets;
- new wepn[24];
- GetWeaponName(weapon, wepn, 24);
- if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
- if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
- if(bullets + trunk[v][vwep1a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
- if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
- trunk[v][vwep1] = weapon;
- trunk[v][vwep1a] = trunk[v][vwep1a] + bullets;
- GivePlayerWeapon(playerid, weapon, -bullets);
- format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
- ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
- }
- else if(trunk[v][vwep2] == weapon || trunk[v][vwep2a] == 0)
- {
- new bullets;
- new wepn[24];
- GetWeaponName(weapon, wepn, 24);
- if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
- if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
- if(bullets + trunk[v][vwep2a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
- if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
- trunk[v][vwep2] = weapon;
- trunk[v][vwep2a] = trunk[v][vwep2a] + bullets;
- GivePlayerWeapon(playerid, weapon, -bullets);
- format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
- ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
- }
- else if(trunk[v][vwep3] == weapon || trunk[v][vwep3a] == 0)
- {
- new bullets;
- new wepn[24];
- GetWeaponName(weapon, wepn, 24);
- if(sscanf(params, "i", bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /tputgun [Ammo]");
- if(bullets > ammo) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo!");
- if(bullets + trunk[v][vwep3a] > 7500) return SendClientMessage(playerid, COLOR_GREY, "Trunk can not have more then 7500 ammo on one slot!");
- if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "Negative Ammo is not possible! Use /ttakegun instead");
- trunk[v][vwep3] = weapon;
- trunk[v][vwep3a] = trunk[v][vwep3a] + bullets;
- GivePlayerWeapon(playerid, weapon, -bullets);
- format(str, sizeof(str), "%s places their %s into the trunk", name, wepn);
- ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
- }
- else return SendClientMessage(playerid, COLOR_GREY, "Trunk is full! Take some stuff out first!");
- }
- return 1;
- }
- CMD:ttakegun(playerid, params[])
- {
- for(new v = 1; v < sizeof(CarInfo); v++)
- {
- new Float:vpx, Float:vpy, Float:vpz;
- GetVehiclePos(v, vpx, vpy, vpz);
- if(!IsPlayerInRangeOfPoint(playerid, 4, vpx, vpy, vpz)) continue;
- if(vehilocked[v] == 1) return SendClientMessage(playerid, COLOR_RED, "This vehicle is locked!");
- new str[128];
- new name[24];
- GetPlayerName(playerid, name, 24);
- new modelid = GetVehicleModel(v);
- new m = GetVehicleModel(v);
- 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!");
- 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!");
- if(modelid == 509 || modelid == 481 || modelid == 510) return SendClientMessage(playerid, COLOR_GREY, "This vehicle does not have a trunk!");
- 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!");
- 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!");
- if(trunk[v][vwep1a] != 0)
- {
- new bullets;
- new slot;
- new wepn[24];
- GetWeaponName(trunk[v][vwep1], wepn, 24);
- if(sscanf(params, "ii", slot, bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ttakegun [Slot] [Ammo]");
- if(bullets > trunk[v][vwep1a]) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo in the trunk!");
- if(trunk[v][vwep1a] - bullets < 0) return SendClientMessage(playerid, COLOR_GREY, "The trunk does not have that much ammo!");
- if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "You must take at least 1 ammo!");
- trunk[v][vwep1a] = trunk[v][vwep1a] - bullets;
- GivePlayerWeapon(playerid, trunk[v][vwep1], bullets);
- format(str, sizeof(str), "%s takes a %s from the trunk", name, wepn);
- ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
- }
- else if(trunk[v][vwep2a] != 0)
- {
- new bullets;
- new slot;
- new wepn[24];
- GetWeaponName(trunk[v][vwep2], wepn, 24);
- if(sscanf(params, "ii", slot, bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ttakegun [Slot] [Ammo]");
- if(bullets > trunk[v][vwep2a]) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo in the trunk!");
- if(trunk[v][vwep2a] - bullets < 0) return SendClientMessage(playerid, COLOR_GREY, "The trunk does not have that much ammo!");
- if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "You must take at least 1 ammo!");
- trunk[v][vwep2a] = trunk[v][vwep2a] - bullets;
- GivePlayerWeapon(playerid, trunk[v][vwep2], bullets);
- format(str, sizeof(str), "%s takes a %s from the trunk", name, wepn);
- ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
- }
- else if(trunk[v][vwep3a] != 0)
- {
- new bullets;
- new slot;
- new wepn[24];
- GetWeaponName(trunk[v][vwep3], wepn, 24);
- if(sscanf(params, "ii", slot, bullets)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ttakegun [Slot] [Ammo]");
- if(bullets > trunk[v][vwep3a]) return SendClientMessage(playerid, COLOR_GREY, "You do not have that much ammo in the trunk!");
- if(trunk[v][vwep3a] - bullets < 0) return SendClientMessage(playerid, COLOR_GREY, "The trunk does not have that much ammo!");
- if(bullets < 1 ) return SendClientMessage(playerid, COLOR_GREY, "You must take at least 1 ammo!");
- trunk[v][vwep3a] = trunk[v][vwep3a] - bullets;
- GivePlayerWeapon(playerid, trunk[v][vwep3], bullets);
- format(str, sizeof(str), "%s takes a %s from the trunk", name, wepn);
- ProxDetector(15.0, playerid, str, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
- }
- else return SendClientMessage(playerid, COLOR_GREY, "Trunk is empty!");
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment