26.04.2009, 12:36
Hello, i was making a trunk system that allow 7 types of trunks, 21slots, 15slots, 10slots, 8slots, 6slots, 3slots, 1slot. With the command for check the trunk on 21slots,6slots, 3slots, 1slot there are no problems i get them work without bug but 15slots,10slots,8slots return half of the command giving at the end Unknown Command. I hope some one will help me
Here is part of the code:
example:
WORKING
NOT WORKING
Here is part of the code:
pawn Код:
case 1:
{
new buffer[512];
new string[250];
new j=GetVehicleModel(result);
//----TRUNK 21 SLOTS----//
if(j==592||j==537||j==538)
{
format(string, sizeof(string), "* Qualcuno ha aperto un bagagliaio");
ProxDetector(15.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
SendClientMessage(playerid, COLOR_ORANGE, "|_______________________ Bagagliaio _______________________|");
for(new slota = 1; slota != 22; slota++)
{
new gunname1a[100];
new gunname2a[100];
new gunname3a[100];
if(slota <= 9)
{
if(vehTrunk21[result][slota] != 0)
{
GetWeaponName(vehTrunk21[result][slota], gunname1a, sizeof(gunname1a));
GetWeaponName(vehTrunk21[result][slota+1], gunname2a, sizeof(gunname2a));
GetWeaponName(vehTrunk21[result][slota+2], gunname3a, sizeof(gunname3a));
format(buffer, sizeof(buffer), "[Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i]", slota, gunname1a, vehTrunkAmmo21[result][slota], slota+1, gunname2a, vehTrunkAmmo21[result][slota+1], slota+2, gunname3a, vehTrunkAmmo21[result][slota+2]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot 0%i] [0] || [Slot 0%i] [0] || [Slot 0%i] [0]", slota, slota+1, slota+2);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
}
else
{
if(vehTrunk21[result][slota] != 0)
{
GetWeaponName(vehTrunk21[result][slota], gunname1a, sizeof(gunname1a));
GetWeaponName(vehTrunk21[result][slota+1], gunname2a, sizeof(gunname2a));
GetWeaponName(vehTrunk21[result][slota+2], gunname3a, sizeof(gunname3a));
format(buffer, sizeof(buffer), "[Slot %i] %s: [%i] || [Slot %i] %s: [%i] || [Slot %i] %s: [%i]", slota, gunname1a, vehTrunkAmmo21[result][slota], slota+1, gunname2a, vehTrunkAmmo21[result][slota+1], slota+2, gunname3a, vehTrunkAmmo21[result][slota+2]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot %i] [0] || [Slot %i] [0] || [Slot %i] [0]", slota, slota+1, slota+2);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
}
slota=slota+2;
}
format(buffer, sizeof(buffer), "GIUBBOTTO A/P: %f%", vehTrunkArmour[result]);
SendClientMessage(playerid, COLOR_GRAD4, buffer);
return SendClientMessage(playerid, COLOR_ORANGE, "ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ");
}
//----TRUNK 15 SLOTS----//
else if(j==511||j==577||j==553||j==548||j==417||j==563)
{
format(string, sizeof(string), "* Qualcuno ha aperto un bagagliaio");
ProxDetector(15.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
SendClientMessage(playerid, COLOR_ORANGE, "|_______________________ Bagagliaio _______________________|");
for(new slotb = 1; slotb != 16; slotb++)
{
new gunname1b[100];
new gunname2b[100];
new gunname3b[100];
if(slotb <= 9)
{
if(vehTrunk15[result][slotb] != 0)
{
GetWeaponName(vehTrunk15[result][slotb], gunname1b, sizeof(gunname1b));
GetWeaponName(vehTrunk15[result][slotb+1], gunname2b, sizeof(gunname2b));
GetWeaponName(vehTrunk15[result][slotb+2], gunname3b, sizeof(gunname3b));
format(buffer, sizeof(buffer), "[Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i]", slotb, gunname1b, vehTrunkAmmo15[result][slotb], slotb+1, gunname2b, vehTrunkAmmo15[result][slotb+1], slotb+2, gunname3b, vehTrunkAmmo15[result][slotb+2]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot 0%i] [0] || [Slot 0%i] [0] || [Slot 0%i] [0]", slotb, slotb+1, slotb+2);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
}
else
{
if(vehTrunk15[result][slotb] != 0)
{
GetWeaponName(vehTrunk15[result][slotb], gunname1b, sizeof(gunname1b));
GetWeaponName(vehTrunk15[result][slotb+1], gunname2b, sizeof(gunname2b));
GetWeaponName(vehTrunk15[result][slotb+2], gunname3b, sizeof(gunname3b));
format(buffer, sizeof(buffer), "[Slot %i] %s: [%i] || [Slot %i] %s: [%i] || [Slot %i] %s: [%i]", slotb, gunname1b, vehTrunkAmmo15[result][slotb], slotb+1, gunname2b, vehTrunkAmmo15[result][slotb+1], slotb+2, gunname3b, vehTrunkAmmo15[result][slotb+2]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot %i] [0] || [Slot %i] [0] || [Slot %i] [0]", slotb, slotb+1, slotb+2);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
}
slotb=slotb+2;
}
format(buffer, sizeof(buffer), "GIUBBOTTO A/P: %f%", vehTrunkArmour[result]);
SendClientMessage(playerid, COLOR_GRAD4, buffer);
return SendClientMessage(playerid, COLOR_ORANGE, "ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ");
}
//----TRUNK 10 SLOTS----//
else if(j==520||j==425||j==499||j==482||j==498||j==609||j==455||j==414||j==582||j==413||j==440||j==459||j==508||j==406||j==423||j==428||j==519||j==456||j==573||j==416||j==433||j==431||j==437||j==427||j==477||j==544||j==484||j==453||j==454)
{
format(string, sizeof(string), "* Qualcuno ha aperto un bagagliaio");
ProxDetector(15.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
SendClientMessage(playerid, COLOR_ORANGE, "|_______________________ Bagagliaio _______________________|");
for(new slotc = 1; slotc != 11; slotc++)
{
new gunname1c[100];
new gunname2c[100];
new gunname3c[100];
if(slotc <= 9)
{
if(vehTrunk10[result][slotc] != 0)
{
GetWeaponName(vehTrunk10[result][slotc], gunname1c, sizeof(gunname1c));
GetWeaponName(vehTrunk10[result][slotc+1], gunname2c, sizeof(gunname2c));
GetWeaponName(vehTrunk10[result][slotc+2], gunname3c, sizeof(gunname3c));
format(buffer, sizeof(buffer), "[Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i]", slotc, gunname1c, vehTrunkAmmo10[result][slotc], slotc+1, gunname2c, vehTrunkAmmo10[result][slotc+1], slotc+2, gunname3c, vehTrunkAmmo10[result][slotc+2]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot 0%i] [0] || [Slot 0%i] [0] || [Slot 0%i] [0]", slotc, slotc+1, slotc+2);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
}
else
{
if(vehTrunk10[result][slotc] != 0)
{
GetWeaponName(vehTrunk21[result][slotc], gunname1c, sizeof(gunname1c));
GetWeaponName(vehTrunk21[result][slotc+1], gunname2c, sizeof(gunname2c));
GetWeaponName(vehTrunk21[result][slotc+2], gunname3c, sizeof(gunname3c));
format(buffer, sizeof(buffer), "[Slot %i] %s: [%i] || [Slot %i] %s: [%i] || [Slot %i] %s: [%i]", slotc, gunname1c, vehTrunkAmmo10[result][slotc], slotc+1, gunname2c, vehTrunkAmmo10[result][slotc+1], slotc+2, gunname3c, vehTrunkAmmo10[result][slotc+2]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot %i] [0] || [Slot %i] [0] || [Slot %i] [0]", slotc, slotc+1, slotc+2);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
}
slotc=slotc+2;
}
format(buffer, sizeof(buffer), "GIUBBOTTO A/P: %f%", vehTrunkArmour[result]);
SendClientMessage(playerid, COLOR_GRAD4, buffer);
return SendClientMessage(playerid, COLOR_ORANGE, "ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ");
}
//----TRUNK 8 SLOTS----//
else if(j==422||j==543 ||j==478 ||j==554 ||j==535 ||j==579 ||j==400 ||j==444 ||j==470 ||j==489 ||j==505 ||j==495 ||j==490 ||j==599 ||j==418 ||j==479 ||j==561 ||j==483 ||j==588 ||j==442 ||j==409 ||j==525 ||j==552 ||j==595 ||j==484 ||j==593 ||j==460 ||j==487 ||j==488 ||j==497)
{
format(string, sizeof(string), "* Qualcuno ha aperto un bagagliaio");
ProxDetector(15.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
SendClientMessage(playerid, COLOR_ORANGE, "|_______________________ Bagagliaio _______________________|");
for(new slotd = 1; slotd != 9; slotd++)
{
new gunname1d[100];
new gunname2d[100];
new gunname3d[100];
if(slotd <= 9)
{
if(vehTrunk8[result][slotd] != 0)
{
GetWeaponName(vehTrunk8[result][slotd], gunname1d, sizeof(gunname1d));
GetWeaponName(vehTrunk8[result][slotd+1], gunname2d, sizeof(gunname2d));
GetWeaponName(vehTrunk8[result][slotd+2], gunname3d, sizeof(gunname3d));
format(buffer, sizeof(buffer), "[Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i]", slotd, gunname1d, vehTrunkAmmo8[result][slotd], slotd+1, gunname2d, vehTrunkAmmo8[result][slotd+1], slotd+2, gunname3d, vehTrunkAmmo8[result][slotd+2]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot 0%i] [0] || [Slot 0%i] [0] || [Slot 0%i] [0]", slotd, slotd+1, slotd+2);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
}
else
{
if(vehTrunk8[result][slotd] != 0)
{
GetWeaponName(vehTrunk8[result][slotd], gunname1d, sizeof(gunname1d));
GetWeaponName(vehTrunk8[result][slotd+1], gunname2d, sizeof(gunname2d));
GetWeaponName(vehTrunk8[result][slotd+2], gunname3d, sizeof(gunname3d));
format(buffer, sizeof(buffer), "[Slot %i] %s: [%i] || [Slot %i] %s: [%i] || [Slot %i] %s: [%i]", slotd, gunname1d, vehTrunkAmmo8[result][slotd], slotd+1, gunname2d, vehTrunkAmmo8[result][slotd+1], slotd+2, gunname3d, vehTrunkAmmo8[result][slotd+2]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot %i] [0] || [Slot %i] [0] || [Slot %i] [0]", slotd, slotd+1, slotd+2);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
}
slotd=slotd+2;
}
format(buffer, sizeof(buffer), "GIUBBOTTO A/P: %f%", vehTrunkArmour[result]);
SendClientMessage(playerid, COLOR_GRAD4, buffer);
return SendClientMessage(playerid, COLOR_ORANGE, "ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ");
}
//----TRUNK 3 SLOTS----//
else if(j==480 ||j==439 ||j==533 ||j==555 ||j==566 ||j==575 ||j==500 ||j==401 ||j==527 ||j==542 ||j==529 ||j==496 ||j==541 ||j==415 ||j==589 ||j==565 ||j==411 ||j==603 ||j==506 ||j==451 ||j==545 ||j==472 ||j==493 ||j==430 ||j==452 ||j==446 ||j==512 ||j==476 ||j==513)
{
format(string, sizeof(string), "* Qualcuno ha aperto un bagagliaio");
ProxDetector(15.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
SendClientMessage(playerid, COLOR_ORANGE, "|_______________________ Bagagliaio _______________________|");
new slotf = 1;
new gunname1f[100];
new gunname2f[100];
new gunname3f[100];
if(vehTrunk3[result][slotf] != 0)
{
GetWeaponName(vehTrunk3[result][slotf], gunname1f, sizeof(gunname1f));
GetWeaponName(vehTrunk3[result][slotf+1], gunname2f, sizeof(gunname2f));
GetWeaponName(vehTrunk3[result][slotf+2], gunname3f, sizeof(gunname3f));
format(buffer, sizeof(buffer), "[Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i]", slotf, gunname1f, vehTrunkAmmo3[result][slotf], slotf+1, gunname2f, vehTrunkAmmo3[result][slotf+1], slotf+2, gunname3f, vehTrunkAmmo3[result][slotf+2]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot 0%i] [0] || [Slot 0%i] [0] || [Slot 0%i] [0]", slotf, slotf+1, slotf+2);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
format(buffer, sizeof(buffer), "GIUBBOTTO A/P: %f%", vehTrunkArmour[result]);
SendClientMessage(playerid, COLOR_GRAD4, buffer);
return SendClientMessage(playerid, COLOR_ORANGE, "ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ");
}
//----TRUNK 1 SLOT----//
else if(j==462||j==448||j==586||j==473||j==522)
{
format(string, sizeof(string), "* Qualcuno ha aperto un bagagliaio");
ProxDetector(15.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
SendClientMessage(playerid, COLOR_ORANGE, "|_______________________ Bagagliaio _______________________|");
new slotg = 1
new gunname1g[100];
if(vehTrunk1[result][slotg] != 0)
{
GetWeaponName(vehTrunk1[result][slotg], gunname1g, sizeof(gunname1g));
format(buffer, sizeof(buffer), "[Slot 0%i] %s: [%i]", slotg, gunname1g, vehTrunkAmmo1[result][slotg]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot 0%i] [0]", slotg);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
return SendClientMessage(playerid, COLOR_ORANGE, "ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ");
}
else if(j==523)
{
format(string, sizeof(string), "* Qualcuno ha aperto un bagagliaio");
ProxDetector(15.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
SendClientMessage(playerid, COLOR_ORANGE, "|_______________________ Bagagliaio _______________________|");
new slotg = 1
new gunname1g[100];
if(vehTrunk1[result][slotg] != 0)
{
GetWeaponName(vehTrunk1[result][slotg], gunname1g, sizeof(gunname1g));
format(buffer, sizeof(buffer), "[Slot 0%i] %s: [%i]", slotg, gunname1g, vehTrunkAmmo1[result][slotg]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot 0%i] [0]", slotg);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
format(buffer, sizeof(buffer), "GIUBBOTTO A/P: %f%", vehTrunkArmour[result]);
SendClientMessage(playerid, COLOR_GRAD4, buffer);
return SendClientMessage(playerid, COLOR_ORANGE, "ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ");
}
//----TRUNK 6 SLOTS----//
else
{
format(string, sizeof(string), "* Qualcuno ha aperto un bagagliaio");
ProxDetector(15.0, playerid, string, PURPLE,PURPLE,PURPLE,PURPLE,PURPLE);
SendClientMessage(playerid, COLOR_ORANGE, "|_______________________ Bagagliaio _______________________|");
for(new slote = 1; slote != 7; slote++)
{
new gunname1e[100];
new gunname2e[100];
new gunname3e[100];
if(slote <= 9)
{
if(vehTrunk6[result][slote] != 0)
{
GetWeaponName(vehTrunk6[result][slote], gunname1e, sizeof(gunname1e));
GetWeaponName(vehTrunk6[result][slote+1], gunname2e, sizeof(gunname2e));
GetWeaponName(vehTrunk6[result][slote+2], gunname3e, sizeof(gunname3e));
format(buffer, sizeof(buffer), "[Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i] || [Slot 0%i] %s: [%i]", slote, gunname1e, vehTrunkAmmo6[result][slote], slote+1, gunname2e, vehTrunkAmmo6[result][slote+1], slote+2, gunname3e, vehTrunkAmmo6[result][slote+2]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot 0%i] [0] || [Slot 0%i] [0] || [Slot 0%i] [0]", slote, slote+1, slote+2);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
}
else
{
if(vehTrunk15[result][slote] != 0)
{
GetWeaponName(vehTrunk6[result][slote], gunname1e, sizeof(gunname1e));
GetWeaponName(vehTrunk6[result][slote+1], gunname2e, sizeof(gunname2e));
GetWeaponName(vehTrunk6[result][slote+2], gunname3e, sizeof(gunname3e));
format(buffer, sizeof(buffer), "[Slot %i] %s: [%i] || [Slot %i] %s: [%i] || [Slot %i] %s: [%i]", slote, gunname1e, vehTrunkAmmo6[result][slote], slote+1, gunname2e, vehTrunkAmmo6[result][slote+1], slote+2, gunname3e, vehTrunkAmmo6[result][slote+2]);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
else
{
format(buffer, sizeof(buffer), "[Slot %i] [0] || [Slot %i] [0] || [Slot %i] [0]", slote, slote+1, slote+2);
SendClientMessage(playerid, COLOR_GRAD2, buffer);
}
}
slote=slote+2;
}
format(buffer, sizeof(buffer), "GIUBBOTTO A/P: %f%", vehTrunkArmour[result]);
SendClientMessage(playerid, COLOR_GRAD4, buffer);
SendClientMessage(playerid, COLOR_ORANGE, "ЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇЇ");
}
return 1;
}
default:
{
SendClientMessage(playerid, COLOR_GREY, "Aiuto: Ci sono piщ veicoli nelle vicinanze");
return 1;
}
WORKING
NOT WORKING