SA-MP Forums Archive
/stats bugged - 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: /stats bugged (/showthread.php?tid=91470)



/stats bugged - narutogeek11 - 15.08.2009

Upon compiling i get no errors but in game all I get is
Код:
Kills: Deaths: Level: Team/Faction:
Please tell me how I am suppose to make it so it tells me how many kills I have I am using Draco Blue's DUDB and DINI
pawn Код:
// on top of script it says Forward ShowPlayerStats(playerid,targetid);
if (strcmp("/stats", cmdtext, true) == 0)
{
    if(logged[playerid] == 1)
{
    ShowStats(playerid,playerid);
}
    return 1;
}
pawn Код:
public ShowStats(playerid,targetid)
{
    new string[256];
    new level = PlayerInfo[targetid][pLevel];
  new kills = PlayerInfo[targetid][pKills];
  new deaths = PlayerInfo[targetid][pDeaths];
  new team = PlayerInfo[targetid][pTeam];
    format(string, sizeof(string), "       **** %s ****      ",playername);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________");
  SendClientMessage(playerid, COLOR_GRAY,string);//playername
    format(string, sizeof(string),"Kills:%s Deaths:%s Level:%s Team/Faction:%s",kills,deaths,level,team);
    SendClientMessage(playerid, COLOR_GRAY,string);//kills deaths etc.
    SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________");
    return 1;
}



Re: /stats bugged - Rusty1337 - 15.08.2009

Remove the forward.

pawn Код:
if (strcmp("/stats", cmdtext, true) == 0)
{
  if(logged[playerid]) ShowStats(playerid,playerid);
  return 1;
}
pawn Код:
stock ShowStats(playerid,targetid)
{
  new string[128];
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________");
  SendClientMessage(playerid, COLOR_GRAY,playername);//playername
  format(string, sizeof(string),"Kills:%i Deaths:%i Level:%i Team/Faction:%i",PlayerInfo[targetid][pKills],PlayerInfo[targetid][pDeaths],PlayerInfo[targetid][pLevel],PlayerInfo[targetid][pTeam]);
  SendClientMessage(playerid, COLOR_GRAY,string);//kills deaths etc.
  SendClientMessage(playerid, COLOR_LIGHTBLUE, "_____________________________________");
  return 1;
}



Re: /stats bugged - narutogeek11 - 15.08.2009

still bugged