My anti team kill works when I attack my enemy
#4

Quote:
Originally Posted by rockhopper
Посмотреть сообщение
Hope this helps
Код:
public OnPlayerDeath( playerid, killerid, reason ) // This is called when a player deaths.
{
    if ( killerid != INVALID_PLAYER_ID ) // If the killerid are NOT an invalid player
    { // Then
        if ( GetPlayerTeam( killerid ) == GetPlayerTeam( playerid ) ) // If killerid's team == playerid's team ( who has been killed )
        { // Then
            SetPlayerHealth( killerid, -1 ); // Kills the killer ( Setting the health to -1 ).

            SendClientMessage( killerid, -1, "No teamkilling." ); // Sends a message to the killer with a white colour ( -1 ), with the message " No teamkilling. ".

            GivePlayerMoney( killerid, - 5000 ); // Take $5000 from the killerid, because teamkilling,
        }

        else // Another team killed the player
        {
            SendClientMessage( killerid, -1, "Nice shot!" ); // Sends a message to the killer with a white colour ( -1 ) with the message "Nice Shot! ".

            GivePlayerMoney( killerid, 5000 ); // Gives the killerid $5000.
        }
    }

    SendDeathMessage(  killerid, playerid, reason ); // Sends a death message about the killerid is killing the player, with the reason ( At the middle right of your game, can be toggled by pressing F9 ).

    return 1; // This means the callback is executed succesfully.
}
REP ME IF I HELPED
No, I am not looking for this, I mean when you shot a player he/she will not be damaged.

Quote:

You are definitely not comparing betw3en YOUR team and the guy who is being shot what you are doing is comparing between your team and the shot player id not his gTeam.

sorry for spalling mistkaes on phone r8 now.

Okay, let me try it
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)