19.05.2014, 11:10
When i kill player other team, anti-teamkill also set my HP to 0
This is my code set team
And this is my code anti-teamkill
This is my code set team
Код:
public SetPlayerTeamFromClass(playerid, classid) { if(classid == 0) { gTeam[playerid] = TEAM_TRIAF; GameTextForPlayer(playerid,"~r~ Mafia Group",3000,5); // This will show up an Text , when you select your class SetPlayerColor(playerid, COLOR_RED); } else if(classid == 1) { gTeam[playerid] = TEAM_COP; GameTextForPlayer(playerid,"~b~Cop",3000,5); SetPlayerColor(playerid, COLOR_BLUE); } else if(classid == 2) { gTeam[playerid] = TEAM_FBI; GameTextForPlayer(playerid,"~b~FBI",3000,5); // This will show up an Text , when you select your class SetPlayerColor(playerid,COLOR_BLUE); // Teamcolor } else if(classid == 3) { gTeam[playerid] = TEAM_BALLAS; GameTextForPlayer(playerid,"~p~Ballas",3000,5); SetPlayerColor(playerid, COLOR_PINK); } else if(classid == 4) { gTeam[playerid] = TEAM_GROVE; GameTextForPlayer(playerid,"~g~Grove Street",3000,5); // This will show up an Text , when you select your class SetPlayerColor(playerid, COLOR_GREEN); // Teamcolor } else if(classid == 5) { gTeam[playerid] = TEAM_AZC; GameTextForPlayer(playerid,"~b~Varios Los Aztecas",3000,5); SetPlayerColor(playerid, COLOR_AQUA); } else if(classid == 6) { gTeam[playerid] = TEAM_VAGOS; GameTextForPlayer(playerid,"~y~Vagos",3000,5); SetPlayerColor(playerid, COLOR_YELLOW); } }
Код:
if(gTeam[killerid] == gTeam[playerid]) { SetPlayerHealth(killerid, 0); GameTextForPlayer(killerid,"~r~You has been killed by server for Team-killing!",4000,3); } return 1; }