16.06.2010, 19:16
I have a way to make it so team kills get kicked. The problem is its not efficient since i gotta add many different combos like
TEAM_COP can't kill TEAM_ARMY
TEAM_ARMY cant kill TEAM_COP
Like that, it's not efficient, how can i just make 1 team kill preventing thing...
This is what i have:
TEAM_COP can't kill TEAM_ARMY
TEAM_ARMY cant kill TEAM_COP
Like that, it's not efficient, how can i just make 1 team kill preventing thing...
This is what i have:
pawn Код:
if(gTeam[killerid] == TEAM_COP && gTeam[playerid] == TEAM_COP && IsSpawned[killerid] == 1 && Jailed[killerid] == 0) {
teamkiller[killerid] +=1;
if(teamkiller[killerid] >=3) {
new str[100];
GetPlayerName(killerid, str, 24);
format(str, 100, "**(AUTO KICK)** %s(%d) Too Many Team Kills(TeamKiller)", str,killerid);
SendClientMessageToAll(0xFF7F50AA, str);
printf("%s", str);
SetPlayerInterior(killerid,10);
SetPlayerPos(killerid,219.6257,111.2549,999.0156);
SetPlayerFacingAngle(killerid,2.2339);
SetCameraBehindPlayer(killerid);
teamkiller[killerid] =0;
Kicking[killerid] =1;
SetTimer("KickPlayer",700,0);
return 1;
}
SendClientMessage(killerid,COLOR_RED, "TEAM KILL - Do not kill other Law Enforcement agents (Blue/Purple)");
SendClientMessage(killerid,COLOR_RED, "If you continue to kill other Law Enforcement agents you will be kicked/banned");
SendDeathMessage(killerid,playerid,reason);
SetPlayerColor(playerid,COLOR_DEADCONNECT);
oscore = GetPlayerScore(killerid);
SetPlayerScore(killerid, oscore -1);
return 1;
}
if(gTeam[killerid] == TEAM_ARMY && gTeam[playerid] == TEAM_ARMY && IsSpawned[killerid] == 1 && Jailed[killerid] == 0) {
teamkiller[killerid] +=1;
if(teamkiller[killerid] >=3) {
new str[100];
GetPlayerName(killerid, str, 24);
format(str, 100, "**(AUTO KICK)** %s(%d) Too Many Team Kills(TeamKiller)", str,killerid);
SendClientMessageToAll(0xFF7F50AA, str);
printf("%s", str);
SetPlayerInterior(killerid,10);
SetPlayerPos(killerid,219.6257,111.2549,999.0156);
SetPlayerFacingAngle(killerid,2.2339);
SetCameraBehindPlayer(killerid);
teamkiller[killerid] =0;
Kicking[killerid] =1;
SetTimer("KickPlayer",700,0);
return 1;
}
SendClientMessage(killerid,COLOR_RED, "TEAM KILL - Do not kill other Law Enforcement agents (Blue/Purple)");
SendClientMessage(killerid,COLOR_RED, "If you continue to kill other Law Enforcement agents you will be kicked/banned");
SendDeathMessage(killerid,playerid,reason);
SetPlayerColor(playerid,COLOR_DEADCONNECT);
oscore = GetPlayerScore(killerid);
SetPlayerScore(killerid, oscore -1);
return 1;
}
if(gTeam[killerid] == TEAM_ARMY && gTeam[playerid] == TEAM_COP && IsSpawned[killerid] == 1 && Jailed[killerid] == 0) {
teamkiller[killerid] +=1;
if(teamkiller[killerid] >=3) {
new str[100];
GetPlayerName(killerid, str, 24);
format(str, 100, "**(AUTO KICK)** %s(%d) Too Many Team Kills(TeamKiller)", str,killerid);
SendClientMessageToAll(0xFF7F50AA, str);
printf("%s", str);
SetPlayerInterior(killerid,10);
SetPlayerPos(killerid,219.6257,111.2549,999.0156);
SetPlayerFacingAngle(killerid,2.2339);
SetCameraBehindPlayer(killerid);
teamkiller[killerid] =0;
Kicking[killerid] =1;
SetTimer("KickPlayer",700,0);
return 1;
}
SendClientMessage(killerid,COLOR_RED, "TEAM KILL - Do not kill other Law Enforcement agents (Blue/Purple)");
SendClientMessage(killerid,COLOR_RED, "If you continue to kill other Law Enforcement agents you will be kicked/banned");
SendDeathMessage(killerid,playerid,reason);
SetPlayerColor(playerid,COLOR_DEADCONNECT);
oscore = GetPlayerScore(killerid);
SetPlayerScore(killerid, oscore -1);
return 1;
}