anti-dm
#1

hey i wanted to create a anti dm but its not working



Код:
#define TEAM_COPS 2

#define TEAM_ORANGE 4


  new killer3[30];
  new lozer[128];
  if(GetPlayerTeam(playerid) != 4 && GetPlayerTeam(playerid) != 2 && GetPlayerTeam(killerid) != 4 && GetPlayerTeam(killerid) != 2)
  {
		if(dm[playerid] == 0)
		{
			SendClientMessage(killerid, COLOR_RED, "	Stop DMing or you get a jail (first warning)");
  	  dm[playerid] = 1;
		}
		if(dm[playerid] == 1)
		{
	 		PlayerInfo[killerid][pInt] = 3;
			SetPlayerInterior(killerid,3);
	 		SetPlayerPos(killerid,197.72,175.06,1003.02);
	 		ResetPlayerWeapons(killerid);
			jailed2[killerid] = 1;
			PlayerInfo[killerid][pJailed] = 1;
			SendClientMessage(killerid, COLOR_GRAD1," You have been jailed for deathmatching.");
			PlayJailSound(1153 , 1154, 2000,264.395200, 77.564040, 1001.039000);
			JailTime[killerid] = 120;
			GetPlayerName(killerid, killer3, 30);
			format(lozer, 128, "[ANTI-DM] %s has been auto jailed for deathmatching", killer3);
			SendClientMessageToAll(COLOR_RED, lozer);
		}
	}
Reply
#2

you say anti dm but there are 2 teams, do you mean anti team kill?
Reply
#3

Quote:
Originally Posted by brett7
you say anti dm but there are 2 teams, do you mean anti team kill?
look

Код:
#define TEAM_FIRE 0
#define TEAM_CYAN 1
#define TEAM_COPS 2
#define TEAM_GREEN 3
#define TEAM_ORANGE 4
#define TEAM_BALLAS 5
#define TEAM_GROVE 6
#define TEAM_VAGOS 7
#define TEAM_AZTECAS 8
#define TEAM_NANG 9
#define TEAM_RIFA 10
#define TEAM_MAFIA 11
#define TEAM_RMAFIA 12
#define TEAM_TRIADS 13
#define TEAM_BIKERS 14
only team cops can shoot team orange but cops van shoot cops and orange can shoot cops and orange you get it?
Reply
#4

Quote:
Originally Posted by Pandabeer1337
Quote:
Originally Posted by brett7
you say anti dm but there are 2 teams, do you mean anti team kill?
look

Код:
#define TEAM_FIRE 0
#define TEAM_CYAN 1
#define TEAM_COPS 2
#define TEAM_GREEN 3
#define TEAM_ORANGE 4
#define TEAM_BALLAS 5
#define TEAM_GROVE 6
#define TEAM_VAGOS 7
#define TEAM_AZTECAS 8
#define TEAM_NANG 9
#define TEAM_RIFA 10
#define TEAM_MAFIA 11
#define TEAM_RMAFIA 12
#define TEAM_TRIADS 13
#define TEAM_BIKERS 14
only team cops can shoot team orange but cops van shoot cops and orange can shoot cops and orange you get it?
no

im confused :S
Reply
#5

i got 14 teams and only the cops and orange are allowed to kill eachother so the rest needs to be warned and stuff.
Reply
#6

atm it looks like you set it to 1 on first kill after sending dm complains then jail them in the next if statment

look here

pawn Код:
on illegal kill
dm[killerid] ++;

if(dm[killerid] != 0)//or var that suits you == n
  {
  sendmessage w/e;
  if(dm[killerid] == 3)// number of kills before punish
    {
    jail(killerid);
    dm[killerid] = 0;
    }
  }
note you use playerid in the dm[id] var, witch punished the guy that killed him ok, but the killer may have only killed once. target the killerid when counting kills. ie dm[killerid] ++;

Reply
#7

Quote:
Originally Posted by Pandabeer1337
hey i wanted to create a anti dm but its not working



Код:
#define TEAM_COPS 2

#define TEAM_ORANGE 4


  new killer3[30];
  new lozer[128];
  if(GetPlayerTeam(playerid) != 4 && GetPlayerTeam(playerid) != 2 && GetPlayerTeam(killerid) != 4 && GetPlayerTeam(killerid) != 2)
  {
		if(dm[playerid] == 0)
		{
			SendClientMessage(killerid, COLOR_RED, "	Stop DMing or you get a jail (first warning)");
  	  dm[playerid] = 1;
		}
		if(dm[playerid] == 1)
		{
	 		PlayerInfo[killerid][pInt] = 3;
			SetPlayerInterior(killerid,3);
	 		SetPlayerPos(killerid,197.72,175.06,1003.02);
	 		ResetPlayerWeapons(killerid);
			jailed2[killerid] = 1;
			PlayerInfo[killerid][pJailed] = 1;
			SendClientMessage(killerid, COLOR_GRAD1," You have been jailed for deathmatching.");
			PlayJailSound(1153 , 1154, 2000,264.395200, 77.564040, 1001.039000);
			JailTime[killerid] = 120;
			GetPlayerName(killerid, killer3, 30);
			format(lozer, 128, "[ANTI-DM] %s has been auto jailed for deathmatching", killer3);
			SendClientMessageToAll(COLOR_RED, lozer);
		}
	}
So c-middia can you fix up my code pleasE?

Quote:
Originally Posted by c-middia
atm it looks like you set it to 1 on first kill after sending dm complains then jail them in the next if statment

look here

pawn Код:
on illegal kill
dm[killerid] ++;

if(dm[killerid] != 0)//or var that suits you == n
  {
  sendmessage w/e;
  if(dm[killerid] == 3)// number of kills before punish
    {
    jail(killerid);
    dm[killerid] = 0;
    }
  }
note you use playerid in the dm[id] var, witch punished the guy that killed him ok, but the killer may have only killed once. target the killerid when counting kills. ie dm[killerid] ++;

Reply
#8

Quote:
Originally Posted by Pandabeer1337
Quote:
Originally Posted by Pandabeer1337
hey i wanted to create a anti dm but its not working



Код:
#define TEAM_COPS 2

#define TEAM_ORANGE 4


  new killer3[30];
  new lozer[128];
  if(GetPlayerTeam(playerid) != 4 && GetPlayerTeam(playerid) != 2 && GetPlayerTeam(killerid) != 4 && GetPlayerTeam(killerid) != 2)
  {
		if(dm[playerid] == 0)
		{
			SendClientMessage(killerid, COLOR_RED, "	Stop DMing or you get a jail (first warning)");
  	  dm[playerid] = 1;
		}
		if(dm[playerid] == 1)
		{
	 		PlayerInfo[killerid][pInt] = 3;
			SetPlayerInterior(killerid,3);
	 		SetPlayerPos(killerid,197.72,175.06,1003.02);
	 		ResetPlayerWeapons(killerid);
			jailed2[killerid] = 1;
			PlayerInfo[killerid][pJailed] = 1;
			SendClientMessage(killerid, COLOR_GRAD1," You have been jailed for deathmatching.");
			PlayJailSound(1153 , 1154, 2000,264.395200, 77.564040, 1001.039000);
			JailTime[killerid] = 120;
			GetPlayerName(killerid, killer3, 30);
			format(lozer, 128, "[ANTI-DM] %s has been auto jailed for deathmatching", killer3);
			SendClientMessageToAll(COLOR_RED, lozer);
		}
	}
So c-middia can you fix up my code pleasE?

Quote:
Originally Posted by c-middia
atm it looks like you set it to 1 on first kill after sending dm complains then jail them in the next if statment

look here

pawn Код:
on illegal kill
dm[killerid] ++;

if(dm[killerid] != 0)//or var that suits you == n
  {
  sendmessage w/e;
  if(dm[killerid] == 3)// number of kills before punish
    {
    jail(killerid);
    dm[killerid] = 0;
    }
  }
note you use playerid in the dm[id] var, witch punished the guy that killed him ok, but the killer may have only killed once. target the killerid when counting kills. ie dm[killerid] ++;

or someone else :>
Reply
#9

pawn Код:
enum
{
    TEAM_FIRE,
    TEAM_CYAN,
    TEAM_COPS,
    TEAM_GREEN,
    TEAM_ORANGE,
    TEAM_BALLAS,
    TEAM_GROVE,
    TEAM_VAGOS,
    TEAM_AZTECAS,
    TEAM_NANG,
    TEAM_RIFA,
    TEAM_MAFIA,
    TEAM_RMAFIA,
    TEAM_TRIADS,
    TEAM_BIKERS,
    MAX_TEAMS
}
pawn Код:
new bool:FightingAllowed[MAX_TEAMS],
    Warnings[MAX_PLAYERS];
pawn Код:
//OnGameModeInit
FightingAllowed[TEAM_FIRE] =    false;
FightingAllowed[TEAM_CYAN] =    false;
FightingAllowed[TEAM_COPS] =    true;
FightingAllowed[TEAM_GREEN] =   false;
FightingAllowed[TEAM_ORANGE] =  true;
FightingAllowed[TEAM_BALLAS] =  false;
FightingAllowed[TEAM_GROVE] =   false;
FightingAllowed[TEAM_VAGOS] =   false;
FightingAllowed[TEAM_AZTECAS] = false;
FightingAllowed[TEAM_NANG] =    false;
FightingAllowed[TEAM_RIFA] =    false;
FightingAllowed[TEAM_MAFIA] =   false;
FightingAllowed[TEAM_RMAFIA] =  false;
FightingAllowed[TEAM_TRIADS] =  false;
FightingAllowed[TEAM_BIKERS] =  false;
pawn Код:
//OnPlayerDeath
    new pTeam = GetPlayerTeam(playerid),
        kTeam = GetPlayerTeam(killerid),
        string[128];
    if(FightingAllowed[pTeam] == false || FightingAllowed[kTeam] == false)
    {
        switch(Warnings[killerid])
        {
            case 0: SendClientMessage(killerid, COLOR_RED, "Stop DMing or you get a jail (first warning)"),
                    Warnings[killerid]++;
            case 1: PlayerInfo[killerid][pInt] = 3,
                    SetPlayerInterior(killerid,3),
                    SetPlayerPos(killerid,197.72,175.06,1003.02),
                    ResetPlayerWeapons(killerid),
                    jailed2[killerid] = 1,
                    PlayerInfo[killerid][pJailed] = 1,
                    SendClientMessage(killerid, COLOR_GRAD1," You have been jailed for deathmatching."),
                    PlayJailSound(1153 , 1154, 2000,264.395200, 77.564040, 1001.039000),
                    JailTime[killerid] = 120,
                    GetPlayerName(killerid, string, MAX_PLAYER_NAME),
                    format(string, sizeof string, "[ANTI-DM] %s has been auto jailed for deathmatching", string),
                    SendClientMessageToAll(COLOR_RED, string),
                    Warnings[killerid]++;
            case 2: Kick(killerid);
        }
    }
pawn Код:
//OnPlayerConnect
Warnings[playerid] = false;
Reply
#10

i tried serveral things but i always get a warnign.

if(FightingAllowed[vTeam] == false && FightingAllowed[kTeam] == false)
if(FightingAllowed[vTeam] == false || FightingAllowed[kTeam] == false)
if(FightingAllowed[vTeam] != true && FightingAllowed[kTeam] != true)

but it won't work..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)