LuxAdmin /stats
#1

Anyone know how do I add other stats like if player Pm is Enabled it will also show in Dialog

Example

Код:
SkinID:
Score:
Kills:
Death:
Ratio:
Pm: Enabled/Disabled (If Player Pm is set to Enable then enabled, if Not then Disabled)
Money:
Ping:
Time Login:

pawn Код:
dcmd_stats(playerid,params[])
{
    new str[512], pDeaths, player1, h, m, s;
    if(!strlen(params)) player1 = playerid;
    else player1 = strval(params);
    if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, red, "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), "%sDeaths: %d\n", str, AccInfo[player1][Deaths]);
    format(str, sizeof(str), "%sRatio: %d\n", str, Float:AccInfo[player1][Kills]/Float:pDeaths);
    format(str, sizeof(str), "%sMoney: $%d\n", str, GetPlayerMoney(player1));
    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;
}
Reply
#2

pawn Код:
new pmStatus[5] = (AccInfo[player1][PMEnabled]) ? "En" : "Dis";

format(str, sizeof(str), "%sPM: %sabled\n", pmStatus);
Reply
#3

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
pawn Код:
new pmStatus[5] = (AccInfo[player1][PMEnabled]) ? "En" : "Dis";

format(str, sizeof(str), "%sPM: %sabled\n", pmStatus);
Wow thanks for the reply! I got warnings:

Код:
error 017: undefined symbol "player1"
error 008: must be a constant expression; assumed zero
Line:
Код:
	new pmStatus[5] = (AccInfo[player1][PMEnabled]) ? "En" : "Dis";
Stats:

Код:
    new pmStatus[5] = (AccInfo[player1][PMEnabled]) ? "En" : "Dis";
    new str[512], pDeaths, player1, h, m, s;
    if(!strlen(params)) player1 = playerid;
    else player1 = strval(params);
    if(!IsPlayerConnected(player1)) return SendClientMessage(playerid, red, "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), "%sDeaths: %d\n", str, AccInfo[player1][Deaths]);
    format(str, sizeof(str), "%sRatio: %d\n", str, Float:AccInfo[player1][Kills]/Float:pDeaths);
    format(str, sizeof(str), "%sPM: %sabled\n", pmStatus);
    format(str, sizeof(str), "%sMoney: $%d\n", str, GetPlayerMoney(player1));
    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;
Reply
#4

Put

pawn Код:
new pmStatus[5] = (AccInfo[player1][PMEnabled]) ? "En" : "Dis";
after

pawn Код:
else player1 = strval(params);
and I don't use LuxAdmin so I don't know if PMEnabled is the correct variable name.
Reply
#5

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
Put

pawn Код:
new pmStatus[5] = (AccInfo[player1][PMEnabled]) ? "En" : "Dis";
after

pawn Код:
else player1 = strval(params);
and I don't use LuxAdmin so I don't know if PMEnabled is the correct variable name.
Yea right

Код:
error 017: undefined symbol "PMEnabled"
error 008: must be a constant expression; assumed zero
Reply
#6

Change

pawn Код:
new pmStatus[5] = (AccInfo[player1][PMEnabled]) ? "En" : "Dis";
to

pawn Код:
new pmStatus[5];

if(AccInfo[player1][PMEnabled]) pmStatus = "En";
else pmStatus = "Dis";
You need to change PMEnabled to the LuxAdmin variable. I've never used LuxAdmin because I always make my own admin system.
Reply
#7

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
Change

pawn Код:
new pmStatus[5] = (AccInfo[player1][PMEnabled]) ? "En" : "Dis";
to

pawn Код:
new pmStatus[5];

if(AccInfo[player1][PMEnabled]) pmStatus = "En";
else pmStatus = "Dis";
You need to change PMEnabled to the LuxAdmin variable. I've never used LuxAdmin because I always make my own admin system.
Last warning: error 017: undefined symbol "PMEnabled" Just need to know what's the variable and problem will be solve.

Anyway people recommend Luxadmin coz of better commands that's why I choose this. Well unanimous decision
Reply
#8

I told you, I don't use LuxAdmin so I don't know the variable name. You should be able to figure it out yourself by looking at the PM command.
Reply
#9

Quote:
Originally Posted by SuperViper
Посмотреть сообщение
I told you, I don't use LuxAdmin so I don't know the variable name. You should be able to figure it out yourself by looking at the PM command.
I delete the pm command in Luxadmin, and create different script take a look, this is created in gamemode.

pawn Код:
CMD:pmo(playerid, params[])
{
    if(DisablePM[playerid] == 0)
    {
        DisablePM[playerid] = 1;
        GameTextForPlayer(playerid, "~y~PM ~r~Disabled", 2000, 3);
    }
    else
    {
        DisablePM[playerid] = 0;
        GameTextForPlayer(playerid, "~y~PM ~g~Enabled", 2000, 3);
    }
    return 1;
}

CMD:pm(playerid, params[])
{
    new pID, Msg[128];
    if(sscanf(params, "ds[128]", pID, Msg)) return SendClientMessage(playerid, -1, "USAGE: /pm [PlayerID] [Message]");
    if(pID == playerid) return SendClientMessage(playerid, 0xFF0000FF, "You can't PM to yourself!");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, 0xFF0000FF, "Invalid PlayerID or the PlayerID is not online!");
    if(DisablePM[pID] == 1) return GameTextForPlayer(playerid, "~n~~n~~r~Player Disabled PM", 3000, 5);
    new str[256], pName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerName(pID, pName2, sizeof(pName2));
    format(str, sizeof(str), "PM Sent to %s (ID: %d): %s", pName2, pID, Msg);
    SendClientMessage(playerid, -1, str);
    format(str, sizeof(str), "PM from %s (ID: %d): %s", pName, playerid, Msg);
    SendClientMessage(pID, -1, str);
    return 1;
}
Reply
#10

Quote:
Originally Posted by kbalor
Посмотреть сообщение
I delete the pm command in Luxadmin, and create different script take a look, this is created in gamemode.

pawn Код:
CMD:pmo(playerid, params[])
{
    if(DisablePM[playerid] == 0)
    {
        DisablePM[playerid] = 1;
        GameTextForPlayer(playerid, "~y~PM ~r~Disabled", 2000, 3);
    }
    else
    {
        DisablePM[playerid] = 0;
        GameTextForPlayer(playerid, "~y~PM ~g~Enabled", 2000, 3);
    }
    return 1;
}

CMD:pm(playerid, params[])
{
    new pID, Msg[128];
    if(sscanf(params, "ds[128]", pID, Msg)) return SendClientMessage(playerid, -1, "USAGE: /pm [PlayerID] [Message]");
    if(pID == playerid) return SendClientMessage(playerid, 0xFF0000FF, "You can't PM to yourself!");
    if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, 0xFF0000FF, "Invalid PlayerID or the PlayerID is not online!");
    if(DisablePM[pID] == 1) return GameTextForPlayer(playerid, "~n~~n~~r~Player Disabled PM", 3000, 5);
    new str[256], pName[MAX_PLAYER_NAME], pName2[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerName(pID, pName2, sizeof(pName2));
    format(str, sizeof(str), "PM Sent to %s (ID: %d): %s", pName2, pID, Msg);
    SendClientMessage(playerid, -1, str);
    format(str, sizeof(str), "PM from %s (ID: %d): %s", pName, playerid, Msg);
    SendClientMessage(pID, -1, str);
    return 1;
}
I tryed to add this command in my gm but :
Код:
C:\Users\ady-kryss\Desktop\RwS Actual\gamemodes\RwS.pwn(99) : error 017: undefined symbol "stoppm"
C:\Users\ady-kryss\Desktop\RwS Actual\gamemodes\RwS.pwn(101) : error 017: undefined symbol "DisablePM"
C:\Users\ady-kryss\Desktop\RwS Actual\gamemodes\RwS.pwn(101) : warning 215: expression has no effect
C:\Users\ady-kryss\Desktop\RwS Actual\gamemodes\RwS.pwn(101) : error 001: expected token: ";", but found "]"
C:\Users\ady-kryss\Desktop\RwS Actual\gamemodes\RwS.pwn(101) : error 029: invalid expression, assumed zero
C:\Users\ady-kryss\Desktop\RwS Actual\gamemodes\RwS.pwn(101) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Lines:
Код:
CMD:stoppm(playerid, params[]
Код:
if(DisablePM[playerid] == 0)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)