SA-MP Forums Archive
Hello can to help mee? [+REP] - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Hello can to help mee? [+REP] (/showthread.php?tid=526476)



Hello can to help mee? [+REP] - arlindi - 17.07.2014

Hello can to help mee with a little scriptxD :P

I want to create if player is cordinate's x y z and will shot by gteam human setplayerhealth killerid 0.
But not killerid i want when take damage.


Re: Hello can to help mee? [+REP] - Kyance - 17.07.2014

Uh..
This?

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        if(gTeam[issuerid] == TEAM_HUMAN)
        {
            if(IsPlayerInRangeOfPoint(issuerid, 5, /*Positions Here*/))
            {
                SetPlayerHealth(issuerid, 0);
                new Float:hp;
                GetPlayerHealth(playerid, hp);
                SetPlayerHealth(playerid, hp+amount);
            }
        }
    }
    return 1;
}



Re: Hello can to help mee? [+REP] - arlindi - 17.07.2014

Love you Bro Thank you so mutch Best Player REPPED xD Thank You xD


Re: Hello can to help mee? [+REP] - arlindi - 17.07.2014

Bro and something work but have a bug.
I want to make if team zombie is in range point when player take damage kill dhat the take damage.
and and team human is in/out range point and shot zombie when zombie is in range point kill human.

PLEASE BRO HELP MEE I WILL REP YOU.


Re: Hello can to help mee? [+REP] - AroseKhanNiazi - 17.07.2014

what do u mean first eplain first part but i think u need to use isplayerinrangeof and an loop for team


Re: Hello can to help mee? [+REP] - arlindi - 17.07.2014

Hmm Look Bro.
If player is team zombie and is in rangepoint x y z. and take damage by team human set health of the human 0.
And Something.
This must work and if player in range point or out range point.


Re: Hello can to help mee? [+REP] - Clad - 17.07.2014

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    PlayerShotPlayer[issuerid][playerid] = 1;

    if(team[issuerid] == TEAM_HUMAN)
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, Coordinates))
        {
            if(team[playerid] == TEAM_ZOMBIE)
            {
                SetPlayerHealth(playerid, 0);
        }
    }
}



Re: Hello can to help mee? [+REP] - AroseKhanNiazi - 17.07.2014

hmm u need to check that he is hitting zombie or not
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        if(gTeam[playerid] == TEAM_HUMAN && gTeam[issuerid] == TEAM_ZOMBIE)
        {
            if(IsPlayerInRangeOfPoint(issuerid, 5, /*Positions Here*/))
            {
                SetPlayerHealth(playerid, 0);
                new Float:hp;
                GetPlayerHealth(issuerid, hp);
                SetPlayerHealth(issuerid, hp+amount);
            }
        }
    }
    return 1;
}
clad i think he wants that if human attacks in the range of that zombie the human gets killed


Re: Hello can to help mee? [+REP] - arlindi - 17.07.2014

Quote:
Originally Posted by Kyance
Посмотреть сообщение
Uh..
This?

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
{
    if(issuerid != INVALID_PLAYER_ID)
    {
        if(gTeam[issuerid] == TEAM_HUMAN)
        {
            if(IsPlayerInRangeOfPoint(issuerid, 5, /*Positions Here*/))
            {
                SetPlayerHealth(issuerid, 0);
                new Float:hp;
                GetPlayerHealth(playerid, hp);
                SetPlayerHealth(playerid, hp+amount);
            }
        }
    }
    return 1;
}
Its somethinglike this but this is if team human and is in range point and shot team zombie kill him.
i want it to
If player zombie and is in range point && get damage by team human set health of the human 0.
Understand ?


Re : Re: Hello can to help mee? [+REP] - ManuelNeuer - 17.07.2014

Quote:
Originally Posted by Clad
Посмотреть сообщение
pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
{
    PlayerShotPlayer[issuerid][playerid] = 1;

    if(team[issuerid] == TEAM_HUMAN)
    {
        if(IsPlayerInRangeOfPoint(playerid, 7.0, Coordinates))
        {
            if(team[playerid] == TEAM_ZOMBIE)
            {
                SetPlayerHealth(playerid, 0);
        }
    }
}
This should work Alindi