Lots of errors, but I can't find a reason.
#1

pawn Код:
new str[50], str1[50], str2[50], str3[50], str4[50], str5[300], weapname1[16], weapname2[16], weapname3[16], weapname4[16], weapname5[16], id = pInfo[playerid][InHouseID];
               
                if(HouseInfo[id][hWeap1] == 0)
                {
                    format(str, 50, "Weapon Slot 1 - Not used");
                }
                else if(HouseInfo[id][hWeap1] != 0)
                {
                    GetWeaponName(HouseInfo[id][hWeap1], weapname1, 16);
                    format(str, 50, "Weapon Slot 1 - %s (Ammo: %i)", weapname1);
                }
               
                if(HouseInfo[id][hWeap2] == 0)
                {
                    format(str1, 50, "Weapon Slot 2 - Not used");
                }
                else if(HouseInfo[id][hWeap2] != 0)
                {
                    GetWeaponName(HouseInfo[id][hWeap2], weapname2, 16);
                    format(str1, 50, "Weapon Slot 2 - %s (Ammo: %i)", weapname2);
                }
               
                if(HouseInfo[id][hWeap3] == 0)
                {
                    format(str2, 50, "Weapon Slot 3 - Not used");
                }
                else if(HouseInfo[id][hWeap3] != 0)
                {
                    GetWeaponName(HouseInfo[id][hWeap3], weapname3, 16);
                    format(str2, 50, "Weapon Slot 3 - %s (Ammo: %i)", weapname3);
                }
               
                if(HouseInfo[id][hWeap4] == 0)
                {
                    format(str3, 50, "Weapon Slot 4 - Not used");
                }
                else if(HouseInfo[id][hWeap4] != 0)
                {
                    GetWeaponName(HouseInfo[id][hWeap4], weapname4, 16);
                    format(str3, 50, "Weapon Slot 4 - %s (Ammo: %i)", weapname4);
                }
               
                if(HouseInfo[id][hWeap5] == 0)
                {
                    format(str4, 50, "Weapon Slot 5 - Not used");
                }
                else if(HouseInfo[id][hWeap5] != 0)
                {
                    GetWeaponName(HouseInfo[id][hWeap5], weapname5, 16);
                    format(str4, 50, "Weapon Slot 5 - %s (Ammo: %i)", weapname5);
                }
                   
                format(str5, 300, "%s\n%s\n%s\n%s\n%s\n", str, str1, str2, str3, str4);
                ShowPlayerDialog(playerid, Weapon_Storage_ChooseSlot, DIALOG_STYLE_LIST, "House - Weapon Storage", str5, "Next", "Close");
These are all the errors I'm getting:
pawn Код:
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(292) : error 029: invalid expression, assumed zero
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(292) : warning 215: expression has no effect
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(292) : warning 215: expression has no effect
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(292) : warning 215: expression has no effect
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(292) : warning 215: expression has no effect
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(292) : warning 215: expression has no effect
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(292) : error 001: expected token: ";", but found ")"
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(292) : error 029: invalid expression, assumed zero
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(292) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Line 292 - ShowPlayerDialog
Reply
#2

This is the right way of doing it. Not more than 2 strings required.
pawn Код:
new string[256];
new weaponname[25];

if (HouseInfo[id][hWeap1] == 0)
    strcat(string, "Weapon Slot 1 - Not used\n");
else
{
    GetWeaponName(HouseInfo[id][hWeap1], weapname, sizeof (weaponname));
    format(string, sizeof (string), "%sWeapon Slot 1 - %s (Ammo: %i)\n", string, weaponname, HouseInfo[id][hAmmo1]);
}

// And so on...upto hWeap5

// Afterwards show your dialog
ShowPlayerDialog(playerid, Weapon_Storage_ChooseSlot, DIALOG_STYLE_LIST, "House - Weapon Storage", string, "Next", "Close");
Also HouseInfo[id][hAmmo1] for reading the weapon's ammo, if you have a different variable/enum element for that, use it instead.
Reply
#3

ok i need help here please https://sampforum.blast.hk/showthread.php?tid=605453
Reply
#4

Quote:
Originally Posted by MarkNelson
Посмотреть сообщение
Sorry, you cannot announce in other's thread to help into your issues first. Be patient and BUMP your topic if there was no response within the said time in Forum Rules.
Reply
#5

I tried as you said, and the same errors are occuring again:
pawn Код:
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(281) : error 029: invalid expression, assumed zero
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(281) : warning 215: expression has no effect
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(281) : warning 215: expression has no effect
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(281) : warning 215: expression has no effect
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(281) : warning 215: expression has no effect
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(281) : warning 215: expression has no effect
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(281) : error 001: expected token: ";", but found ")"
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(281) : error 029: invalid expression, assumed zero
C:\Users\Rakshith Rahul\Desktop\HSystem.pwn(281) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
And this is the code:
pawn Код:
new string[256], weapname[25], id = pInfo[playerid][InHouseID];

                if (HouseInfo[id][hWeap1] == 0)
                    strcat(string, "Weapon Slot 1 - Not used\n");
                else
                {
                    GetWeaponName(HouseInfo[id][hWeap1], weapname, sizeof (weapname));
                    format(string, sizeof (string), "%sWeapon Slot 1 - %s (Ammo: %i)\n", string, weapname, HouseInfo[id][hAmmo1]);
                }
               
                if(HouseInfo[id][hWeap2] == 0)
                    strcat(string, "Weapon Slot 2 - Not Used\n");
                else
                {
                    GetWeaponName(HouseInfo[id][hWeap2], weapname, sizeof (weapname));
                    format(string, sizeof string, "%sWeapon Slot 2 - %s (Ammo: %i)\n", string, weapname, HouseInfo[id][hAmmo2]);
                }
               
                if(HouseInfo[id][hWeap3] == 0)
                    strcat(string, "Weapon Slot 3 - Not Used\n");
                else
                {
                    GetWeaponName(HouseInfo[id][hWeap3], weapname, sizeof (weapname));
                    format(string, sizeof string, "%sWeapon Slot 3 - %s (Ammo: %i)\n", string, weapname, HouseInfo[id][hAmmo3]);
                }
               
                if(HouseInfo[id][hWeap4] == 0)
                    strcat(string, "Weapon Slot 4 - Not Used\n");
                else
                {
                    GetWeaponName(HouseInfo[id][hWeap4], weapname, sizeof (weapname));
                    format(string, sizeof string, "%sWeapon Slot 4 - %s (Ammo: %i)\n", string, weapname, HouseInfo[id][hAmmo4]);
                }
               
                if(HouseInfo[id][hWeap5] == 0)
                    strcat(string, "Weapon Slot 5 - Not Used\n");
                else
                {
                    GetWeaponName(HouseInfo[id][hWeap5], weapname, sizeof (weapname));
                    format(string, sizeof string, "%sWeapon Slot 5 - %s (Ammo: %i)\n", string, weapname, HouseInfo[id][hAmmo5]);
                }
               
                ShowPlayerDialog(playerid, Weapon_Storage_ChooseSlot, DIALOG_STYLE_LIST, "House - Weapon Storage", string, "Next", "Close");
Reply
#6

Connection problem. Sorry for the double post.
Reply
#7

Have you defined this?
pawn Код:
Weapon_Storage_ChooseSlot
Reply
#8

oh wait! I haven't assumed a dialog number for it. Anyway, it's fixed now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)