Quote:
Originally Posted by Psymetrix
I don't use pvars but this is how the wiki suggests you do it:
pawn Код:
// GetPVarString - This function returns the length of player's PVarString. new string[128]; if (!GetPVarString(playerid, "Report", string, 128)) { SendClientMessage(playerid, COLOR_GREY, "This player doesn't have an active report"); }
|
There's one more problem. I want to get the value from the PVar and display it.
pawn Код:
CMD:reports(playerid, params[])
{
new string[128];
if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command.");
if(!aDuty[playerid]) return SendClientMessage(playerid, COLOR_GREY, "You are not on admin duty.");
SendClientMessage(playerid, COLOR_REPORT, "Pending Reports:");
foreach(Player, i)
{
if (GetPVarString(i, "Report", string, 128))
{
new rtext[128];
GetPVarString(i, "Report", rtext, 128);
format(string, sizeof(string), "Report from {FF6347}[%d] {FFFF91}%s: %s", i, GetPlayerNameEx(i), rtext);
}
}
return 1;
}
Here's my code. Its bugged atm, but can you fix it?