17.03.2014, 16:55
The problem is when I want to put something in trunk it says this: "Empty Slot (0)" How can I remove that (0) so it will write only empty slot? If weapon is there there will be a number with ammo for example (7..
pawn Код:
if(listitem == 1) // Put in trunk
{
for(new i; i<MAX_VEHICLES; i++)
{
new vehicleid = GetClosestVehicle(playerid);
new Float: vx, Float:vy, Float:vz;
new e, l, a, d, b, bo, o;
GetVehicleParamsEx(i,e,l,a,d,b,bo,o);
GetVehiclePos(i,vx,vy,vz);
GetXYBehindCar(i, vx, vy, 2.5);
if(IsPlayerInRangeOfPoint(playerid,2.5,vx,vy,vz))
{
if(bo > 0)
{
new tstr[255];
format(tstr, sizeof(tstr), "Slot 1 - %s (%d)\nSlot 2 - %s (%d)\nSlot 3 - %s (%d)\nSlot 4 - %s (%d)\nSlot 5 - %s (%d)", GetGunName(iTrunk[vehicleid][tWeapon1]),iTrunk[vehicleid][tAmmo1], GetGunName(iTrunk[vehicleid][tWeapon2]),iTrunk[vehicleid][tAmmo2], GetGunName(iTrunk[vehicleid][tWeapon3]),iTrunk[vehicleid][tAmmo3], GetGunName(iTrunk[vehicleid][tWeapon4]),iTrunk[vehicleid][tAmmo4],GetGunName(iTrunk[vehicleid][tWeapon5]),iTrunk[vehicleid][tAmmo5]);
ShowPlayerDialog(playerid, DIALOG_PUT, DIALOG_STYLE_LIST, "Store a weapon", tstr, "Select", "Cancel");
return 1;
}
else
{
SendClientMessage(playerid, -1,"{FF6A22}INFO: {FFFFFF} Open the trunk before putting something inside.");
return 1;
}
}
}
}