SA-MP Forums Archive
Deaths aren't counting help! - 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: Deaths aren't counting help! (/showthread.php?tid=146262)



Deaths aren't counting help! - kujox32 - 06.05.2010

pawn Код:
new kills = PlayerInfo[playerid][pKills];
  SetPlayerScore(playerid, kills);
  new Float:Health;
  GetPlayerHealth(playerid, Health);
  if(Health == 0.0)
  {
   PlayerInfo[playerid][pDeaths] += 1;
  }
  GivePlayerMoney(killerid,3000);
  PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 1;
  if(team[killerid] != team[playerid])
  {
Can anyone tell me how to get deaths to count cause this isn't working I don't know anything else to do I removed the = sign and it still didn't fix it.


Re: Deaths aren't counting help! - [cA]Unforseen - 06.05.2010

Quote:
Originally Posted by kujox32
pawn Код:
new kills = PlayerInfo[playerid][pKills];
  SetPlayerScore(playerid, kills);
  new Float:Health;
  GetPlayerHealth(playerid, Health);
  if(Health == 0.0)
  {
  PlayerInfo[playerid][pDeaths] += 1;
  }
  GivePlayerMoney(killerid,3000);
  PlayerInfo[killerid][pKills] = PlayerInfo[killerid][pKills] + 1;
  if(team[killerid] != team[playerid])
  {
Can anyone tell me how to get deaths to count cause this isn't working I don't know anything else to do I removed the = sign and it still didn't fix it.
try this:

pawn Код:
new kills = PlayerInfo[playerid][pKills];
  SetPlayerScore(playerid, kills);
  new Float:Health;
  GetPlayerHealth(playerid, Health);
  if(Health == 0.0)
  {
   kills++;
  }
  GivePlayerMoney(killerid,3000);
  PlayerInfo[killerid][pKills] = kills;
  if(team[killerid] != team[playerid])
  {



Re: Deaths aren't counting help! - kujox32 - 06.05.2010

Didn't work. This is my Stats system could anything in here be the problem?

pawn Код:
public ShowStats(playerid,targetid)
{
  if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
    {
        new cash = GetPlayerMoney(targetid);
        new deaths = PlayerInfo[targetid][pDeaths];
        new kills = PlayerInfo[targetid][pKills];
        new name[MAX_PLAYER_NAME];
        GetPlayerName(targetid, name, sizeof(name));
        new Float:px,Float:py,Float:pz;
        GetPlayerPos(targetid, px, py, pz);
        new coordsstring[256];
        SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
        format(coordsstring, sizeof(coordsstring),"*** %s ***",name);
        SendClientMessage(playerid, COLOR_WHITE,coordsstring);
        format(coordsstring, sizeof(coordsstring), "Kills:[%d] Deaths:[%d] Cash:[$%d]",kills,deaths,cash);
        SendClientMessage(playerid, COLOR_GRAD5,coordsstring);
        SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
    }
}



Re: Deaths aren't counting help! - Killa_ - 06.05.2010

pawn Код:
PlayerInfo[killerid][pKills]++;
  SetPlayerScore(killerid, PlayerInfo[killerid][pKills]);
  GivePlayerMoney(killerid,3000);
  PlayerInfo[playerid][pDeaths]++;
  if(team[killerid] != team[playerid])
  {



Re: Deaths aren't counting help! - kujox32 - 06.05.2010

Quote:
Originally Posted by Killa_
pawn Код:
PlayerInfo[killerid][pKills]++;
  SetPlayerScore(killerid, PlayerInfo[killerid][pKills]);
  GivePlayerMoney(killerid,3000);
  PlayerInfo[playerid][pDeaths]++;
  if(team[killerid] != team[playerid])
  {
Thanks that worked