Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CMD:check(playerid, params[])
- {
- if(!pLoggedIn[playerid])return true;
- new string[2000], hid = IsPlayerInProperty(playerid);
- string[0] = 0;
- new
- Float:x,
- Float:y,
- Float:z
- ;
- if(IsPlayerInAnyVehicle(playerid)) // if player is in a vehicle
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(!IsValidFactionCar(vehicleid) && !IsValidPlayerCar(vehicleid))
- return SendClientMessage(playerid, COLOR_ADM, "SERVER: This command can only be used for private vehicles. You are in a public static vehicle.");
- if(IsValidPlayerCar(vehicleid))
- {
- for(new i = 1; i < 5; i++)
- {
- if(!CarData[vehicleid][carWeapons][i])
- format(string, sizeof(string), "%sWeapon %d: [Empty]\n", string, i);
- else
- format(string, sizeof(string), "%sWeapon %d: %s[Ammo: %d]\n", string, i, ReturnWeaponName(CarData[vehicleid][carWeapons][i]), CarData[vehicleid][carWeaponsAmmo][i]);
- ShowPlayerDialog(playerid, DIALOG_USE, DIALOG_STYLE_LIST, "Trunk", string, ">>>", "");
- }
- }
- else if(IsValidFactionCar(vehicleid))
- {
- if(FactionCar[vehicleid][carFaction] > 0 && FactionCar[vehicleid][carFaction] == PlayerData[playerid][pFaction] && FactionCar[vehicleid][carGunRack])
- {
- 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", "");
- }
- }
- }
- else if(!IsPlayerInAnyVehicle(playerid) && GetNearestVehicle(playerid) != INVALID_VEHICLE_ID) // if player out of veh and near trunk
- {
- new vehicleid = GetNearestVehicle(playerid);
- GetVehicleBoot(vehicleid, x, y, z);
- if(!IsValidFactionCar(vehicleid) && !IsValidPlayerCar(vehicleid))
- return SendClientMessage(playerid, COLOR_ADM, "SERVER: This command can only be used for private vehicles. You are in a public static vehicle.");
- if(!IsPlayerInRangeOfPoint(playerid, 2.5, x, y, z))
- return SendClientMessage(playerid, COLOR_YELLOW, "You aren't near the vehicles trunk.");
- if(IsValidPlayerCar(vehicleid))
- {
- for(new i = 1; i < 5; i++)
- {
- if(!CarData[vehicleid][carWeapons][i])
- format(string, sizeof(string), "%sWeapon %d: [Empty]\n", string, i);
- else
- format(string, sizeof(string), "%sWeapon %d: %s[Ammo: %d]\n", string, i, ReturnWeaponName(CarData[vehicleid][carWeapons][i]), CarData[vehicleid][carWeaponsAmmo][i]);
- ShowPlayerDialog(playerid, DIALOG_USE, DIALOG_STYLE_LIST, "Trunk", string, ">>>", "");
- }
- }
- else if(IsValidFactionCar(vehicleid))
- {
- if(FactionCar[vehicleid][carFaction] > 0 && FactionCar[vehicleid][carFaction] == PlayerData[playerid][pFaction] && FactionCar[vehicleid][carGunRack])
- {
- 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", "");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement