19.03.2015, 16:34
pawn Код:
CMD:vgetwep(playerid, params[])
{
new vehicleid = GetClosestVehicle(playerid);
new string[128],string1[256];
if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
if(VehicleSQLID[vehicleid] < 1) return SendClientMessage(playerid, COLOUR_GREY, "You cannot store a weapon in this vehicle.");
new model = GetVehicleModel(vehicleid) - 400;
new amount;
for(new x = 1; x < MAX_WEAPONS; x++)
{
if(VehWepStored[x] == VehicleSQLID[vehicleid])
{
if(amount == 0)
{
format(string1, sizeof(string1),"Weapon: %s Ammo: %d",WeaponNames[WepModel[x]], WepAmmo[x]);
}
if(amount > 0)
{
format(string1, sizeof(string1),"%s\nWeapon: %s Ammo: %d",string1, WeaponNames[WepModel[x]], WepAmmo[x]);
}
amount++;
}
}
if(amount == 0)
{
SendClientMessage(playerid, COLOUR_GREY, "There are no weapons in this vehicle.");
}
format(string, sizeof(string), "%s Weapons", VehicleNames[model]);
ShowPlayerDialog(playerid, DIALOG_GETVEHWEP, DIALOG_STYLE_LIST, string, string1, "Select", "Close");
return 1;
}