Making an Anti DM system
#1

Hey,

I'm currently scripting a CNR server and I was wondering how I can make an Anti DM system. I already have teams and stuff, but I want to restrict like Cops killing civillians (or any other team) only killing wanted players.

How am I able to do this?

Thanks
Reply
#2

callback OnPlayerTakeDamage and function GetPlayerTeam or use scripted variables.
Reply
#3

Quote:
Originally Posted by ball
Посмотреть сообщение
callback OnPlayerTakeDamage and function GetPlayerTeam or use scripted variables.
Could you please explain a little bit more?
Reply
#4

Any help?
Reply
#5

Use this https://sampforum.blast.hk/showthread.php?tid=195439
Reply
#6

Quote:
Originally Posted by bgedition
Посмотреть сообщение
Can you make it just using the current SA:MP functions and not any includes?
Reply
#7

May be use OnPlayerTakeDamage or OnPlayerTargetPlayer
Reply
#8

Quote:
Originally Posted by bgedition
Посмотреть сообщение
May be use OnPlayerTakeDamage or OnPlayerTargetPlayer
I'm not sure if this is right, please correct me if I'm wrong. Would something like this work?

pawn Код:
public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart)
{
    if(!IsALawEnforcement(issuerid) && gTeam[playerid] == TEAM_CIV )
    {
        return 0;
    }
    return 1;
}
Reply
#9

I will you give example:

pawn Код:
public OnPlayerTargetPlayer(playerid) {
    new targetid = GetPlayerTargetPlayer(playerid);
    if(IsPolice(playerid)) {
        if(GetPlayerWantedLevel(targetid) == 0) {
            SendClientMessage(playerid, /*color*/, "[ATTENTION]: This player is not suspected. You can't kill it.");
        }
    }
    return 1;
}
I'm not shure for this but try it
Reply
#10

Quote:
Originally Posted by bgedition
Посмотреть сообщение
I will you give example:

pawn Код:
public OnPlayerTargetPlayer(playerid) {
    new targetid = GetPlayerTargetPlayer(playerid);
    if(IsPolice(playerid)) {
        if(GetPlayerWantedLevel(targetid) == 0) {
            SendClientMessage(playerid, /*color*/, "[ATTENTION]: This player is not suspected. You can't kill it.");
        }
    }
    return 1;
}
If you replace the ATTENTION message with return 0, that would not allow the player to shoot the other player, right?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)