A player hits another player with fists and server crash
#1

Basically when a player in my server hits another player, the server crashes idk why.


These are the only callbacks that could have caused this that I could find

I don't see a problem myself so I'm asking for you guys to help me

OnPlayerGiveDamage is empty.


pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    new Float:HP;
    GetPlayerHealth(playerid, HP);
    new Float:Armor;
    GetPlayerArmour(playerid, Armor);
    TextDrawShowForPlayer(playerid,flash);
    SetTimerEx("Flash", 1500, false, "i", playerid);
    if(weaponid == 24) SetPlayerArmour(playerid, Armor-15);
    if(weaponid == 22) SetPlayerArmour(playerid, Armor-5);
    if(weaponid == 23) SetPlayerArmour(playerid, Armor-5);
    if(weaponid == 25) SetPlayerArmour(playerid, Armor-20);
    if(weaponid == 28) SetPlayerArmour(playerid, Armor-13);
    if(weaponid == 29) SetPlayerArmour(playerid, Armor-15);
    if(weaponid == 30) SetPlayerArmour(playerid, Armor-7);
    if(weaponid == 31) SetPlayerArmour(playerid, Armor-11);
    if(weaponid == 33) SetPlayerArmour(playerid, Armor-25);
    if(weaponid == 34) SetPlayerArmour(playerid, Armor-28);
    if(weaponid == 24) SetPlayerHealth(playerid, HP-40);
    if(weaponid == 22) SetPlayerHealth(playerid, HP-27);
    if(weaponid == 23) SetPlayerHealth(playerid, HP-26);
    if(weaponid == 25) SetPlayerHealth(playerid, HP-30);
    if(weaponid == 28) SetPlayerHealth(playerid, HP-15);
    if(weaponid == 29) SetPlayerHealth(playerid, HP-20);
    if(weaponid == 30) SetPlayerHealth(playerid, HP-30);
    if(weaponid == 31) SetPlayerHealth(playerid, HP-35);
    if(weaponid == 33) SetPlayerHealth(playerid, HP-40);
    if(weaponid == 34) SetPlayerHealth(playerid, HP-80);
    if(Rubber[issuerid] == 1)
    {
        SetPlayerHealth(playerid, HP-0);
        SetPlayerArmour(playerid, Armor-0);
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
        ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0);
        SetTimerEx("AnimRubber", 9500, false, "i", playerid);
        return 1;
    }
    if(DeathState[playerid] == 1)
    {
        SetPlayerHealth(playerid, 1);
        SetPlayerArmour(playerid, 0);
    }
    if(bodypart == 9)
    {
        Headwound[playerid]++;
        ApplyAnimation(playerid, "ped", "SHOT_partial", 2, 0, 0, 0, 0, 0, 1);
    }
    if(bodypart == 8)
    {
        Rightlegwound[playerid]++;
    }
    if(bodypart == 7)
    {
        Leftlegwound[playerid]++;
    }
    if(bodypart == 6)
    {
        ApplyAnimation(playerid, "ped", "SHOT_rightP", 2, 0, 0, 0, 0, 0, 1);
        Rightarmwound[playerid]++;
    }
    if(bodypart == 5)
    {
        ApplyAnimation(playerid, "ped", "SHOT_leftP", 2, 0, 0, 0, 0, 0, 1);
        Leftarmwound[playerid]++;
    }
    if(bodypart == 3)
    {
        Stomachwound[playerid]++;
        ApplyAnimation(playerid, "ped", "SHOT_partial_B", 2, 0, 0, 0, 0, 0, 1);
    }
    return 1;
}
pawn Код:
forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    new string[128], weapons[13][2], log[256];
    for(new i=0; i<13; i++)
    {
        GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
        if(weapons[i][0] != PlayerInfo[playerid][pWeapon][i])
        {
            format(string, sizeof(string), "%s is possibly weapon hacking.", Wizza(playerid));
            SendAdminMessage(COLOR_GREEN, 1, string);
            ResetWizzaWeapons(playerid);
            Log("logs/gunhacks.log", log);
            return 1;
        }
    }
    if(hittype == BULLET_HIT_TYPE_PLAYER)
    {
        TextDrawShowForPlayer(hitid,flash);
        SetTimerEx("Flash", 1500, false, "i", hitid);
        if(freezeplayer[playerid] == 1)
        {
            if(GetPlayerWeapon(playerid) == 34)
            {
                format(string, sizeof(string), "%s has used freezeshoot on %s freezing them.", Wizza(playerid), Wizza(hitid));
                SendAdminMessage(COLOR_WHITE, 1, string);
                format(string, sizeof(string), "%s has freezed you, using freezeshooting.", Wizza(playerid));
                SendClientMessage(hitid, COLOR_WHITE, string);
                TogglePlayerControllable(hitid, 0);
                TextDrawShowForPlayer(hitid,flash);
                SetTimerEx("Flash", 1500, false, "i", hitid);
            }
            else if(GetPlayerWeapon(playerid) == 31)
            {
                format(string, sizeof(string), "%s has used freezeshoot on %s unfreezing them.", Wizza(playerid), Wizza(hitid));
                SendAdminMessage(COLOR_WHITE, 1, string);
                format(string, sizeof(string), "%s has unfreezed you, using freezeshooting.", Wizza(playerid));
                SendClientMessage(hitid, COLOR_WHITE, string);
                TogglePlayerControllable(hitid, 1);
                TextDrawShowForPlayer(hitid,flash);
                SetTimerEx("Flash", 1500, false, "i", hitid);
            }
        }
        if(banhammer[playerid] == 1)
        {
            if(GetPlayerWeapon(playerid) == 31)
            {
                format(string, sizeof(string), "BH: %s has kicked %s", Wizza(playerid), Wizza(hitid));
                SendClientMessageToAll(COLOR_GREY, string);
                Kick(hitid);
            }
            else if(GetPlayerWeapon(playerid) == 25)
            {
                format(string, sizeof(string), "BH: %s has banned %s", Wizza(playerid), Wizza(hitid));
                SendClientMessageToAll(COLOR_BANMAN, string);
                format(string, sizeof(string), "BH: %s has banned %s %s", Wizza(playerid), Wizza(hitid));
                Log("logs/ban.log", string);
                // Banning
                PlayerInfo[hitid][pBanned] = 1;
                // Banreason
                new file[32];
                format(file, sizeof(file), "users/%s.ini", WizzaU(hitid));
                dini_Set(file, "BannedBy", WizzaU(playerid));
                // BanList
                AddBan(hitid);
                Kick(hitid);
            }
        }
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)