Little Help
#1

So If do /rep [playerid] [amount] to a player.

Then when he do /stats it must be shown something like this below.

Kills:24
Deaths:872
Reputation: 4

I have already added under enum playerdata

Код:
Under Register
dUserSetINT(PlayerName2(playerid)).("Rep",0);

dUserSetINT(PlayerName2(playerid)).("Rep",0);

Under dcmd_stats
format(str, sizeof(str), "%Reputation: %d\n", str, AcciIfo(player1));

Under LoginPlayer
(dUserINT(PlayerName2(playerid)).("Rep"));

Under SavePlayerStats
dUserSetINT(PlayerName2(playerid)).("Rep",AccInfo[playerid][Rep]);
No warning after compiling then I do /stats in game I don't see Reputation:


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;
}
Reply
#2

You are only showing your /rep. Have you made your /stats yet?
Reply
#3

Quote:
Originally Posted by ikkentim
Посмотреть сообщение
You are only showing your /rep. Have you made your /stats yet?
I am using Luxadmin it already have /stats

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)