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;
}
Originally Posted by (SF)Noobanatior
if(gTeam[killerid] == gTeam[playerid])//team kill happened
|
public OnPlayerSpawn(playerid)
{
SetPlayerTeam(playerid, 1); // sets the players team to 1 when they spawn.
return 1;
}
Originally Posted by ViruZZzZ_ChiLLL
Maybe on spawn, set their team?
pawn Код:
I think that will automatically make them have God Mode for their team-mates in-case they Shoot at their team-mates. |
if(gTeam[playerid] == TEAM_COP) {
SetPlayerPos( playerid, 1573.7228,-1694.9384,6.2188);
SendClientMessage(playerid,0x1E90FFAA, "Type /commands for your commands");
SendClientMessage(playerid,0x1E90FFAA, "POLICE OFFICER: Your job is to keep criminals off the streets of San Andreas");
SendClientMessage(playerid,0x1E90FFAA, "Remember: This is not a deathmatch server. Please abide by the /rules and enjoy");
hastazer[playerid] =1;
HasLawEnforcementRadio[playerid] =1;
LawEnforcementRadio[playerid] =1;
TextDrawShowForPlayer(playerid,txtTypeSkill1);
CanChooseSkill[playerid] = 0;
SetPlayerTeam(playerid, TEAM_COP);
}
Originally Posted by ruckfules99
Trying to fix the same thing, wont work
![]() |
Originally Posted by (SF)Noobanatior
set gTeam for everyplayer on the server and then the SetPlayerTeam just for the cops
then just check if(gTeam[killerid] == gTeam[playerid]) //teamkill for the other teams and no one can kill you coz you are setting the players team to 1 for everyone when they spawn you only want to do this for the cop skins |
SetPlayerTeamFromClass(playerid, classid) {
if(classid == 0 || classid == 1 || classid == 2 || classid == 3 || classid == 4 || classid == 5 || classid == 6 || classid == 7 || classid == 10) {
gTeam[playerid] = TEAM_COP;
} else if(classid == 8) {
gTeam[playerid] = TEAM_ARMY;
} else if(classid == 9) {
gTeam[playerid] = TEAM_CASSEC;
} else if(classid == 11) {
gTeam[playerid] = TEAM_AIRSUPPORT;
} else if(classid == 12) {
gTeam[playerid] = TEAM_MARINE;
} else if(classid == 13) {
gTeam[playerid] = TEAM_JAILTK;
} else if(classid == 14) {
gTeam[playerid] = TEAM_MEDIC;
} else if(classid == 15) {
gTeam[playerid] = TEAM_MECHANIC;
} else if(classid == 16) {
gTeam[playerid] = TEAM_BISTRO;
} else if(classid == 17 || classid == 18) {
gTeam[playerid] = TEAM_DRIVER;
} else if(classid >= 19 && classid <= 64) {
gTeam[playerid] = TEAM_CIVIL;
}
}