18.12.2010, 18:46
When a team has a player and I shoot with me not to go to his?
forward SettingPlayerTeam();
SetTimerEx("SettingPlayerTeam",10,1,"i",playerid);
public SettingPlayerTeam() { for(new playerid; playerid < 200; playerid++) SetPlayerTeam(playerid, gTeam[playerid]); return 1; }
public OnPlayerDeath(playerid, killerid, reason)
{
if( gTeam[ playerid ] == gTeam[ killerid ] )
{
SetPlayerDrunkLevel(playerid, 0);
GivePlayerMoney(killerid, -1000);
SetPlayerScore(killerid,GetPlayerScore(killerid)-2);
SendClientMessage(killerid, COLOR_BRIGHTRED, "You have teamkilled, you lost $1000 and 2 score");
}
else
{
new string[128];
GetPlayerName(playerid,string,sizeof(string));
format(string,sizeof(string),"You have killed %s and you gained 1000$ and 1 score",string);
SendClientMessage(killerid, COLOR_GREEN, string);
SetPlayerDrunkLevel(playerid, 0);
GivePlayerMoney(killerid,1000);
SetPlayerScore(killerid,GetPlayerScore(killerid)+1);
}
return 1;
}