*** Terrible Title Removed
#1

pawn Code:
printf("%d",PlayersDamaged[issuerid][PlayerI[issuerid][PlayersHit]]);
if(PlayersDamaged[issuerid][idSlot[playerid][issuerid]] == playerid)
        {
            DamageIS[issuerid][playerid] += amount;
            print("samedamager");
}
        if(idSlot[playerid][issuerid] == -1)
        {
            DamageIS[issuerid][playerid] = amount;
            PlayerI[issuerid][PlayersHit]++;
            PlayerI[playerid][pDamagers]++;
            idSlot[playerid][issuerid] = PlayerI[issuerid][PlayersHit];
            PlayersDamaged[issuerid][PlayerI[issuerid][PlayersHit]] = playerid;
            print("1dmger");
        }
        printf("Hitted player slot: %d",PlayersDamaged[issuerid][PlayerI[issuerid][PlayersHit]]);
Whats the problem here? Well here we go, the first print doesn't print ANYTHING to console, even a blank message doesn't come up, the code in first IF doesn't get red SOMEWHY. Switching both ifs side, putting the first below the second - EVERYTHING WORKS, WTF? In the second IF it should set the PlayersDamaged[issuerid][PlayerI[issuerid][PlayersHit]] to the playerid that has been hit, well it doesn't do anything unless switched above the first if! The second print prints -1 like the first print should do but doesn't, can someone explain what the hell is happening here? the variables are constant when this code is happening, I have no idea what's wrong and tried few variants of solving this problem

EDIT:

pawn Code:
if(idSlot[playerid][issuerid] == -1)
        {
        //    DamageIS[issuerid][playerid] = amount;
            PlayerI[issuerid][PlayersHit]++;
            PlayerI[playerid][pDamagers]++;
            idSlot[playerid][issuerid] = PlayerI[issuerid][PlayersHit];
            PlayersDamaged[issuerid][PlayerI[issuerid][PlayersHit]] = playerid;
            print("1dmger");
        }
I fixed some parts of the code not working before edit, I've got this code and it only works for one player, when it must be executed for the second player, only the idSlot[playerid][issuerid] = PlayerI[issuerid][PlayersHit]; and I believe the pDamagers variable gets executed and written correctly to players info.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)