Can't hit players
#1

So when I am on top of a island which I used to create by using ID 17143, I can't hit another player. But I am able to hit on normal San Andreas land. Any fix?
Reply
#2

Common bug when you are on an island mapped far away from SA, you cant deal melee damage.
Reply
#3

You can script the melee damaging in script-wise how-ever(I'm assuming...),

Maybe this will work?
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(!IsPlayerInAnyVehicle(playerid) && newkeys & KEY_FIRE)
    {
        if(IsPlayerConnected(playerid) && GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID)
        {
            if(IsPlayerInRangeOfPoint(playerid, 100.0, x, y, z))
            {
                new i = GetPlayerTargetPlayer(playerid);
                new Float: dmgamount;
                GetPlayerHealth(i, dmgamount);
                SetPlayerHealth(i, dmgamount - 5);
                return true;
            }
        }
    }
    return true;
}
Of-course replacing X, Y, Z with the coordinates of your island, not sure if this would work or not.
Reply
#4

Quote:
Originally Posted by Abagail
Посмотреть сообщение
You can script the melee damaging in script-wise how-ever(I'm assuming...),

Maybe this will work?
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if(!IsPlayerInAnyVehicle(playerid) && newkeys & KEY_FIRE)
    {
        if(IsPlayerConnected(playerid) && GetPlayerTargetPlayer(playerid) != INVALID_PLAYER_ID)
        {
            if(IsPlayerInRangeOfPoint(playerid, 100.0, x, y, z))
            {
                new i = GetPlayerTargetPlayer(playerid);
                new Float: dmgamount;
                GetPlayerHealth(i, dmgamount);
                SetPlayerHealth(i, dmgamount - 5);
                return true;
            }
        }
    }
    return true;
}
Of-course replacing X, Y, Z with the coordinates of your island, not sure if this would work or not.
This is OK, but you need to add a limit or an animation check because if you click very fast it will kill you in seconds.

The bug happens when you give damage outside of the San Andreas Map boundries (-3000 x 3000).
Reply
#5

It's really not that far, just near some mountains. Anyways, I'll give a try.
Reply
#6

Had the same problem and it never really got fixed
Reply
#7

Quote:
Originally Posted by ATV
Посмотреть сообщение
Had the same problem and it never really got fixed
The code above helped me fixed it, I put some extra measures like if player is looking at target, and if the weaponid is 0. If you want to hit, you have to right click and hit, then it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)