OnPlayerTakeDamage [+REP]
#1

PHP код:
public OnPlayerTakeDamage(playeridissueridFloatamountweaponid)
{
    
PlayerShotPlayer[issuerid][playerid] = 1;
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == KICKBACK || pInfo[issuerid][pVipKickBack] == || pInfo[issuerid][pKickBackCoin])
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 23 || weaponid == 25 || weaponid == 24 || weaponid == 34 || weaponid == 31 || weaponid == 29)
                {
                    new 
Float:x,Float:y,Float:z,Float:angle;
                    
GetPlayerFacingAngle(playerid,Float:angle);
                    
GetPlayerVelocity(playerid,Float:x,Float:y,Float:z);
                    
SetPlayerVelocity(playerid,Float:x+0.1,Float:y+0.1,Float:z+0.2);
                    
SetPlayerFacingAngle(playerid,Float:angle);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == KICKBACK || pInfo[issuerid][pVipKickBack] == || pInfo[issuerid][pKickBackCoin])
        {
            if(
pInfo[issuerid][pZombieClass] == KZOM)
            {
                if(
weaponid == 23 || weaponid == 25 || weaponid == 24 || weaponid == 34 || weaponid == 31 || weaponid == 29 || weaponid == 27)
                {
                    new 
Float:x,Float:y,Float:z,Float:angle;
                    
GetPlayerFacingAngle(playerid,Float:angle);
                    
GetPlayerVelocity(playerid,Float:x,Float:y,Float:z);
                    
SetPlayerVelocity(playerid,Float:x+0.0,Float:y+0.0,Float:z+0.0);
                    
SetPlayerFacingAngle(playerid,Float:angle);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_ZOMBIE)
    {
        if(
pInfo[issuerid][pZombieClass] == DSNIPE)
        {
            if(
team[playerid] == TEAM_HUMAN)
            {
                if(
weaponid == 34)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 10);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == AKICK)
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 27)
                {
                    new 
Float:x,Float:y,Float:z,Float:angle;
                    
GetPlayerFacingAngle(playerid,Float:angle);
                    
GetPlayerVelocity(playerid,Float:x,Float:y,Float:z);
                    
SetPlayerVelocity(playerid,Float:x+0.3,Float:y+0.3,Float:z+0.4);
                    
SetPlayerFacingAngle(playerid,Float:angle);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == VIPSCOUT || pInfo[issuerid][pHumanClass] == MASTER || pInfo[issuerid][pHumanClass] == BUDDY || pInfo[issuerid][pHumanClass] == HITMAN)
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 34 || weaponid == 29 || weaponid == 14 || weaponid == 33 || weaponid == 30)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 40);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_ZOMBIE)
    {
        if(
pInfo[issuerid][pZombieClass] == GZOM)
        {
            if(
team[playerid] == TEAM_HUMAN)
            {
                if(
weaponid == 9)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 40);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_ZOMBIE || TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHour] <= 2)
        {
            if(
team[playerid] == TEAM_HUMAN)
            {
                
pInfo[issuerid][pXP] += 10;
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == COWBOY)
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 22)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 20);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == ASSASSIN)
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 8)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 100);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == PIMP)
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 10)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 15);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == EXPERIENCEDSCOUT)
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 34 || weaponid == 23 )
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 80);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == SCOUT || pInfo[issuerid][pHumanClass] == HEAVYSHOTGUN || pInfo[issuerid][pHumanClass] == KICKBACK || pInfo[issuerid][pDamageShotgunCoin] == || pInfo[issuerid][pHumanClass] == BOXER)
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 25)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 35);
                }
                if(
weaponid == 0)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 100);
                }
                if(
weaponid == 34)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 35);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == TECG)
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 32)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 35);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == BULL)
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 26)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 40);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == ELITE)
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 26)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 20);
                }
                if(
weaponid == 24)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 70);
                }
                if(
weaponid == 32)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 5);
                }
                if(
weaponid == 31)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 15);
                }
            }
        }
    }
    if(
team[issuerid] == TEAM_HUMAN)
    {
        if(
pInfo[issuerid][pHumanClass] == HERSHEL)
        {
            if(
team[playerid] == TEAM_ZOMBIE)
            {
                if(
weaponid == 25)
                {
                new 
Float:hp;
                
GetPlayerHealth(playerid,hp);
                
SetPlayerHealth(playeridhp 30);
                }
            }
        }
    }
/*    if(issuerid != INVALID_PLAYER_ID) // Spawn KIll
    {
        if(team[issuerid] == TEAM_HUMAN && team[playerid] == TEAM_ZOMBIE)
        {
            if(IsPlayerInRangeOfPoint(playerid,5,Map[ZombieSpawnX],Map[ZombieSpawnY],Map[ZombieSpawnZ]))
            {
                SetPlayerHealth(issuerid, 0);
                new Float:hp;
                new string[256];
                GetPlayerHealth(playerid, hp);
                SetPlayerHealth(playerid, hp+amount);
                GameTextForPlayer(issuerid, "~w~You are zombie because you were~n~spawn killing", 5000,3);
                format(string,sizeof(string), "%s has been set to zombie because he/she was spawn killing!",PlayerName(issuerid));
                SendClientMessageToAll(0x800000C8,string);
            }
        }
    }*/
    
return 1;

OnPlayerTakeDamageFunction


I get this in server log

PHP код:
[14:42:34] [debugRun time error 4"Array index out of bounds"
[14:42:34] [debug]  Accessing element at index 65535 past array upper bound 999
[14:42:34] [debugAMX backtrace:
[
14:42:34] [debug#0 00038794 in public OnPlayerTakeDamage (0, 65535, 1079194420, 54, 3) from zma4.amx 
Reply


Messages In This Thread
OnPlayerTakeDamage [+REP] - by arlindi - 20.05.2015, 18:44
Re: OnPlayerTakeDamage [+REP] - by Konstantinos - 20.05.2015, 18:46
Re: OnPlayerTakeDamage [+REP] - by vyper - 20.05.2015, 18:48
Re: OnPlayerTakeDamage [+REP] - by arlindi - 20.05.2015, 18:48
Re: OnPlayerTakeDamage [+REP] - by vyper - 20.05.2015, 18:50
Re: OnPlayerTakeDamage [+REP] - by arlindi - 20.05.2015, 18:51
Re: OnPlayerTakeDamage [+REP] - by Konstantinos - 20.05.2015, 18:53
Re: OnPlayerTakeDamage [+REP] - by vyper - 20.05.2015, 18:55
Re: OnPlayerTakeDamage [+REP] - by arlindi - 20.05.2015, 18:55
Re: OnPlayerTakeDamage [+REP] - by rappy93 - 20.05.2015, 19:00

Forum Jump:


Users browsing this thread: 6 Guest(s)