OnPlayerDeath
#7

Quote:
Originally Posted by zDevon
View Post
There is an exclamation mark instead of an equals sign in your OnPlayerGiveDamage.

pawn Code:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    if(gTeam[playerid] == TEAM_COP || TEAM_ARMY)
    {
    }
    if(gTeam[playerid] == TEAM_COP || TEAM_ARMY)
    {
        if(GetPlayerWantedLevel(playerid) == 0)
        {
            SetPlayerWantedLevel(playerid,1);
            SendClientMessage(playerid,COLOR_RED,"You are now wanted player ! ");
            SetPlayerColor(playerid,COLOR_PURPLE);
        }
    }
    else
    {
    }
    return 1;
}
Edit: You found it.
Here he's using a Value there that isn't even needed "waste of space" and which is why it causes issues to the on damage


pawn Code:
public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
{
    /*if(gTeam[playerid] == TEAM_COP || TEAM_ARMY)
    {
    }*/

        // No point in the above code since there is nothing to return as we will edit below this to return the correct value
    //if(gTeam[playerid] == TEAM_COP || TEAM_ARMY) // when using "||" your telling the code to return the Value to either Team which i guess you don't want to do, so now we need to make it "If isn't TEAM_COP" but is "TEAM_ARMY" this is what you do below
        if(gTeam[playerid] != TEAM_COP) // So now if the player isn't listed as "TEAM_COP" it will apply the below code to any other TEAM made
    {
        if(GetPlayerWantedLevel(playerid) == 0)
        {
            SetPlayerWantedLevel(playerid,1);
            SendClientMessage(playerid,COLOR_RED,"You are now wanted player ! ");
            SetPlayerColor(playerid,COLOR_PURPLE);
        }
    }
    return 1;
}
I only did // to explain what changes i made and so you can understand what i did for the "OnPlayerGiveDamage".
Reply


Messages In This Thread
OnPlayerDeath - by Djumza - 06.06.2012, 15:26
Re: OnPlayerDeath - by MadeMan - 06.06.2012, 15:38
Re: OnPlayerDeath - by Djumza - 06.06.2012, 16:21
Re: OnPlayerDeath - by MadeMan - 06.06.2012, 16:51
Re: OnPlayerDeath - by Djumza - 07.06.2012, 04:51
Re: OnPlayerDeath - by zDevon - 07.06.2012, 04:56
Re: OnPlayerDeath - by Shaneisace - 07.06.2012, 07:13
Re: OnPlayerDeath - by Djumza - 07.06.2012, 18:16
Re: OnPlayerDeath - by Djumza - 08.06.2012, 11:53
Re: OnPlayerDeath - by Djumza - 10.06.2012, 10:19
Re: OnPlayerDeath - by Shaneisace - 11.06.2012, 05:16
Re: OnPlayerDeath - by Djumza - 11.06.2012, 20:28

Forum Jump:


Users browsing this thread: 1 Guest(s)