Advertisement
Oblivion_UFF

Split

Feb 8th, 2020
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. CMD:check(playerid, params[])
  2. {
  3. if(!pLoggedIn[playerid])return true;
  4.  
  5. new string[2000], hid = IsPlayerInProperty(playerid);
  6.  
  7. string[0] = 0;
  8. new
  9. Float:x,
  10. Float:y,
  11. Float:z
  12. ;
  13.  
  14. if(IsPlayerInAnyVehicle(playerid)) // if player is in a vehicle
  15. {
  16.  
  17. new vehicleid = GetPlayerVehicleID(playerid);
  18.  
  19. if(!IsValidFactionCar(vehicleid) && !IsValidPlayerCar(vehicleid))
  20. return SendClientMessage(playerid, COLOR_ADM, "SERVER: This command can only be used for private vehicles. You are in a public static vehicle.");
  21.  
  22. if(IsValidPlayerCar(vehicleid))
  23. {
  24. for(new i = 1; i < 5; i++)
  25. {
  26. if(!CarData[vehicleid][carWeapons][i])
  27. format(string, sizeof(string), "%sWeapon %d: [Empty]\n", string, i);
  28.  
  29. else
  30. format(string, sizeof(string), "%sWeapon %d: %s[Ammo: %d]\n", string, i, ReturnWeaponName(CarData[vehicleid][carWeapons][i]), CarData[vehicleid][carWeaponsAmmo][i]);
  31.  
  32. ShowPlayerDialog(playerid, DIALOG_USE, DIALOG_STYLE_LIST, "Trunk", string, ">>>", "");
  33. }
  34. }
  35. else if(IsValidFactionCar(vehicleid))
  36. {
  37. if(FactionCar[vehicleid][carFaction] > 0 && FactionCar[vehicleid][carFaction] == PlayerData[playerid][pFaction] && FactionCar[vehicleid][carGunRack])
  38. {
  39. ShowPlayerDialog(playerid, DIALOG_USE, DIALOG_STYLE_LIST, "Trunk", "Weapon 1: Shotgun[Ammo: 100]\nWeapon 2: MP5[Ammo:200]\nWeapon 3: M4[Ammo:200]\nWeapon 4: SPAZ[Ammo:100]\nWeapon 5: Sniper[Ammo:50]\nWeapon 6: Camera\nWeapon 7: Pepperspray", "Ok", "");
  40. }
  41. }
  42. }
  43. else if(!IsPlayerInAnyVehicle(playerid) && GetNearestVehicle(playerid) != INVALID_VEHICLE_ID) // if player out of veh and near trunk
  44. {
  45.  
  46. new vehicleid = GetNearestVehicle(playerid);
  47.  
  48. GetVehicleBoot(vehicleid, x, y, z);
  49.  
  50. if(!IsValidFactionCar(vehicleid) && !IsValidPlayerCar(vehicleid))
  51. return SendClientMessage(playerid, COLOR_ADM, "SERVER: This command can only be used for private vehicles. You are in a public static vehicle.");
  52.  
  53. if(!IsPlayerInRangeOfPoint(playerid, 2.5, x, y, z))
  54. return SendClientMessage(playerid, COLOR_YELLOW, "You aren't near the vehicles trunk.");
  55.  
  56. if(IsValidPlayerCar(vehicleid))
  57. {
  58. for(new i = 1; i < 5; i++)
  59. {
  60. if(!CarData[vehicleid][carWeapons][i])
  61. format(string, sizeof(string), "%sWeapon %d: [Empty]\n", string, i);
  62.  
  63. else
  64. format(string, sizeof(string), "%sWeapon %d: %s[Ammo: %d]\n", string, i, ReturnWeaponName(CarData[vehicleid][carWeapons][i]), CarData[vehicleid][carWeaponsAmmo][i]);
  65.  
  66. ShowPlayerDialog(playerid, DIALOG_USE, DIALOG_STYLE_LIST, "Trunk", string, ">>>", "");
  67. }
  68. }
  69. else if(IsValidFactionCar(vehicleid))
  70. {
  71. if(FactionCar[vehicleid][carFaction] > 0 && FactionCar[vehicleid][carFaction] == PlayerData[playerid][pFaction] && FactionCar[vehicleid][carGunRack])
  72. {
  73. ShowPlayerDialog(playerid, DIALOG_USE, DIALOG_STYLE_LIST, "Trunk", "Weapon 1: Shotgun[Ammo: 100]\nWeapon 2: MP5[Ammo:200]\nWeapon 3: M4[Ammo:200]\nWeapon 4: SPAZ[Ammo:100]\nWeapon 5: Sniper[Ammo:50]\nWeapon 6: Camera\nWeapon 7: Pepperspray", "Ok", "");
  74. }
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement