SA-MP Forums Archive
[NEED HELP]OnPlayerDeath... - 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: [NEED HELP]OnPlayerDeath... (/showthread.php?tid=127735)



[NEED HELP]OnPlayerDeath... - yoan103 - 14.02.2010

I have this code...

Код:
public OnPlayerDeath(playerid,killerid,reason)
{
  new str[128],playersname[24],killersname[24];
  GetPlayerName(playerid,playersname,24);
  GetPlayerName(killerid,killersname,24);
  format(str,sizeof(str),"%s has been killed by %s",playersname,killersname);
  SendClientMessage(playerid, COLOR_ORANGE,str);
  return 1;
}
Ok but i still haven't found when a player dies by himself it says me:
Someone has been killed by, and nothing else, someone is the playersname
Can i fix this?


Re: [NEED HELP]OnPlayerDeath... - yoan103 - 14.02.2010

I am really soory for the bump but i need to fix this... please...


Re: [NEED HELP]OnPlayerDeath... - Sergei - 14.02.2010

pawn Код:
public OnPlayerDeath(playerid,killerid,reason)
{
  if(killerid != INVALID_PLAYER_ID)
  {
    new str[80],name[2][MAX_PLAYER_NAME];
    GetPlayerName(playerid,name[0],MAX_PLAYER_NAME); GetPlayerName(killerid,name[1],MAX_PLAYER_NAME);
    format(str,sizeof(str),"%s has been killed by %s",name[0],name[1]); SendClientMessage(playerid, COLOR_ORANGE,str);
  }
  return 1;
}