How to make team kill for PlayerSkin
#1





Help me please

How to make team kill for PlayerSkin(105,106,107) and (102,103,104)

public OnPlayerSpawn(playerid)
if(gTeam[playerid] == TEAM_GROVE) {

SetPlayerSkin(playerid,105);
SetPlayerColor(playerid,COLOR_GREEN); // Green

}
else if(gTeam[playerid] == TEAM_GROVE1) {

SetPlayerSkin(playerid,106);
SetPlayerColor(playerid,COLOR_GREEN); // Green

}
else if(gTeam[playerid] == TEAM_GROVE2) {

SetPlayerSkin(playerid,107);
SetPlayerColor(playerid,COLOR_GREEN); // Green

}
else if(gTeam[playerid] == TEAM_BALLA) {

SetPlayerSkin(playerid,102);
SetPlayerColor(playerid,COLOR_BLUE); // Blue

}
else if(gTeam[playerid] == TEAM_BALLA1) {

SetPlayerSkin(playerid,103);
SetPlayerColor(playerid,COLOR_BLUE); // Blue

}
else if(gTeam[playerid] == TEAM_BALLA2) {

SetPlayerSkin(playerid,104);
SetPlayerColor(playerid,COLOR_BLUE); // Blue

}

return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{

if(killerid == INVALID_PLAYER_ID)

{

SendDeathMessage(INVALID_PLAYER_ID,playerid,reason );
}



else {

if(gTeam[killerid] != gTeam[playerid]) {

// Valid kill

SendDeathMessage(killerid,playerid,reason);
UAS_GivePlayerMoney(killerid,1000);
}

else
{

//Team Killer!
SendClientMessage(killerid, COLOR_YELLOW, "Не стреляй в своих!");
SendDeathMessage(killerid,playerid,reason);
SetPlayerHealth(killerid,0.0);
UAS_GivePlayerMoney(killerid,-2000);
}
}

return 1;
}
Reply
#2

just use setplayerteam it avoids teamkilling
Reply
#3

Quote:
Originally Posted by saiberfun
just use setplayerteam it avoids teamkilling
I used SetPlayerTeam did not work
Even tried AddStaticClassEx did not work too
Reply
#4

You want to give everyone in the team the money?
Reply
#5

Quote:
Originally Posted by CAR
You want to give everyone in the team the money?
I want to combine into one team (playerskin 105,106,107 groove ) and (102,103,104 ballas)
And if (playerskin 105 killed playerskin 106)= SetPlayerHeath(105,0) etc.
Reply
#6

Quote:
Originally Posted by RedFaction444
I used SetPlayerTeam did not work
Even tried AddStaticClassEx did not work too
for me setplayerteam works fine
Reply
#7

public OnPlayerSpawn(playerid)
if(gTeam[playerid] == TEAM_GROVE) {

SetPlayerSkin(playerid,105);
SetPlayerColor(playerid,COLOR_GREEN); // Green
SetPlayerTeam( playerid, 1 );
}
Yes?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)