So If do /rep [playerid] [amount] to a player.
Then when he do /stats it must be shown something like this below.
pawn Код:
#include <a_samp>
#include <sscanf2>
#include <zcmd>
new pRep[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
pRep[playerid] = 0;
return 1;
}
dcmd:rep(playerid,params[])
{
new rep,target,pName[MAX_PLAYER_NAME],string1[124],string[124],pTarget[MAX_PLAYER_NAME];
if(sscanf(params,"ui",target,rep)) return SendClientMessage(playerid,-1,"/rep [playerid] [reputation]");
new oldrep = pRep[target];
pRep[target] = oldrep+rep;
GetPlayerName(target,pTarget,MAX_PLAYER_NAME);
format(string,sizeof(string),"You gave %s(ID:%d) +%d reputation!",pTarget,target,rep);
SendClientMessage(playerid,-1,string);
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string1,sizeof(string1),"%s,(ID:%d) has gave you +%d reputation.",pName,playerid,rep);
SendClientMessage(target,-1,string1);
return 1;
}
You are only showing your /rep. Have you made your /stats yet?
pawn Код:
dcmd_stats(playerid,params[])
{
new str[512], pDeaths, player1, h, m, s;
new status[2][10] = {"Disabled", "Enabled"};
if(!strlen(params)) player1 = playerid;
else player1 = strval(params);
if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, white, "{FF0000}ERROR: Player Not Connected");
TotalGameTime(player1, h, m, s);
if(AccInfo[player1][Deaths] == 0) pDeaths = 1;
else pDeaths = AccInfo[player1][Deaths];
format(str, sizeof(str), "{DAA520}%s (ID: %d){B0C4DE}\n\n", PlayerName2(player1), player1);
format(str, sizeof(str), "%sSkinID: %d\n", str, GetPlayerSkin(player1));
format(str, sizeof(str), "%sScore: %d\n", str, GetPlayerScore(player1));
format(str, sizeof(str), "%sKills: %d\n", str, AccInfo[player1][Kills]);
format(str, sizeof(str), "%sMoney: $%d\n", str, GetPlayerMoney(player1));
format(str, sizeof(str), "%sRatio: %d\n\n", str, Float:AccInfo[player1][Kills]/Float:pDeaths);
format(str, sizeof(str), "%sInterior: %d\n", str, GetPlayerInterior(player1));
format(str, sizeof(str), "%sVirtual World: %d\n", str, GetPlayerVirtualWorld(player1));
format(str, sizeof(str), "%sWanted Level: %d\n\n", str, GetPlayerWantedLevel(player1));
format(str, sizeof(str), "%sPM: %s\n", str, status[GetPVarInt(player1, "PMEnabled")]);
format(str, sizeof(str), "%sGod: %s\n", str, status[GetPVarInt(player1, "GodMode")]);
format(str, sizeof(str), "%sGo's: %s\n\n", str, status[GetPVarInt(player1, "GotoEnabled")]);
format(str, sizeof(str), "%sPing: %d\n", str, GetPlayerPing(player1));
format(str, sizeof(str), "%sTime Login: %d hours %d minutes %d seconds\n", str, h, m, s);
ShowPlayerDialog(playerid, 8435, DIALOG_STYLE_MSGBOX, "Player Statistics", str, "Close", "");
return 1;
}
#endif