OnPlayerDeath doesnґt work!
#1

hi,

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  new Lv,pName[MAX_PLAYER_NAME];
  GetPlayerName(killerid, pName, sizeof(pName));
	Lv = GetPlayerWantedLevel(killerid);

	if(killerid == INVALID_PLAYER_ID) {
  SendDeathMessage(INVALID_PLAYER_ID,playerid,reason);
	} else if(gTeam[killerid] == 0 || gTeam[killerid] == 1) {
  SendDeathMessage(killerid,playerid,reason);
	} else {
  Lv+=1;
  SetPlayerWantedLevel(killerid,Lv);
  SendDeathMessage(killerid,playerid,reason);
  }
	return 1;
}
it doesnґt work,can anyone help me ,please?

EDIT: 0 = team_army / 1 = team_police
Reply
#2

Could you be more specific?
Reply
#3

Try using this code:

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  new Lv,pName[MAX_PLAYER_NAME];
  GetPlayerName(killerid, pName, sizeof(pName));
  Lv = GetPlayerWantedLevel(killerid);

  if(killerid == INVALID_PLAYER_ID)
  {
    SendDeathMessage(INVALID_PLAYER_ID, playerid, reason);
  } else {
    SendDeathMessage(killerid, playerid, reason);

    if(gTeam[killerid] != gTeam[playerid])
    {
      Lv+=1;
      SetPlayerWantedLevel(killerid,Lv);
      SendDeathMessage(killerid,playerid,reason);
    }
    return 1;
  }
}
Reply
#4

no,i mean,the army and police can kill someone,but the others(pilots,civils) get a star,you unterstand me?

Sry for my bad english!
Reply
#5

I think you just need change the:
Код:
if(gTeam[killerid] != gTeam[playerid])
to
Код:
if(gTeam[killerid] != 0 || gTeam[killerid] != 1)
Reply
#6

yes,iґm will test it,but not today
thank you all
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)