SA-MP Forums Archive
How to make team kill for PlayerSkin - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How to make team kill for PlayerSkin (/showthread.php?tid=92254)



How to make team kill for PlayerSkin - RedFaction444 - 19.08.2009





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;
}


Re: How to make team kill for PlayerSkin - saiberfun - 19.08.2009

just use setplayerteam it avoids teamkilling


Re: How to make team kill for PlayerSkin - RedFaction444 - 19.08.2009

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


Re: How to make team kill for PlayerSkin - CAR - 19.08.2009

You want to give everyone in the team the money?


Re: How to make team kill for PlayerSkin - RedFaction444 - 19.08.2009

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.


Re: How to make team kill for PlayerSkin - saiberfun - 19.08.2009

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


Re: How to make team kill for PlayerSkin - RedFaction444 - 20.08.2009

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

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