OnPlayerDeath
#1

Well Hello Guys, I wanna to make it like when TEAM_COP, do kill TEAM_CIVIL the 3rd time he will get kicked from the server, but i dont know how to do it with the 3rd time, anyone knows it? If its bad explained ill explain it better
Reply
#2

Is it unclear?
Reply
#3

You mean if a cop kill civilian 3 times he got kicked ?
If yes use a variable and OnplayerDeath edit it
Reply
#4

Yea, you know what i meaned But i dunno how to do it
Reply
#5

Does someone knows the variable?
Reply
#6

You have to do it like make a variable and add 1 point to it when ever a player kills a civilian,and when it reaches to 3 he get's kicked simple.Use a timer that keeps on checking player's points.and example of adding
pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
    if(GetPlayerTeam(playerid) == TEAM_CIVIL)
    {
        PlayerInfo[killerid][point] += 1;
        if(PlayerInfo[killerid][point] == 3)return Kick(killerid);
    }
    return 1;
}
This is an example not tested and tell me if something goes wrong.
Reply
#7

so this is when Cop or other teams shoot civil 3 times he will get kicked?
Reply
#8

pawn Код:
new TimesCopKilledCivilian[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    TimesCopKilledCivilian[playerid] = 0;
    return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
    if(gTeam[playerid] == TEAM_CIVIL)
    {
        if(gTeam[killerid] == TEAM_COP)
        {
            if(TimesCopKilledCivilian[killerid] != 3)
            {
                TimesCopKilledCivilian[killerid] += 1;
            }
            else Kick(killerid);
        }
    }
    return 1;
}
That would do it if you have gTeam.
Reply
#9

Works ThanZ Rep for sure
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)