Evo svi Stock-0ve 😁
stock deleteReportsBy(playerid)
{
new
count = 0
;
if(!IsPlayerConnected(playerid))
return count;
new nombre_1;
format(nombre_1, sizeof(nombre_1), GetPlayerNameEx(playerid));
new nombre_temp;
for(new i; i < sizeof(ReportData); i++) if(ReportExist(i))
{
if(!(0 <= ReportData < MAX_PLAYERS))
continue;
format(nombre_temp, sizeof(nombre_temp), GetPlayerNameEx(ReportData));
if(!CompareString(nombre_1:nombre_temp))
continue;
DeleteReport(i);
count ++;
}
return count;
}
stock DeleteReport(id)
{
if(IsValidReport(id))
return 0;
ReportData = false;
ReportData = '\0';
ReportData = INVALID_PLAYER_ID;
ReportData = '\0';
return 1;
}
stock CreateReport(playerid, reportado, razon[])
{
for(new i; i < sizeof(ReportData); i++)
{
if(ReportExist(i))
continue;
ReportData = true;
format(ReportData, MAX_PLAYER_NAME, GetPlayerNameEx(reportado));
ReportData = playerid;
format(ReportData, MAX_REPORT_STRING, razon);
return i;
}
return -1;
}
stock ShowPlayerReports(playerid)
{
new
string,
count = 0,
index
;
format(string, sizeof(string), "Report #\tIgrac koje reportovao\tRepotrovan Igrac\tRazlog");
for(new i; i < sizeof(ReportData); i++)
{
if(!ReportExist(i))
continue;
format(string, sizeof(string), "%s\n#%i\t%s\t%s\t%s",
string,
i,
GetPlayerNameEx(getReportValue(i->reporteDe)),
getReportValue(i->reportePara),
cutMessage(getReportValue(i->reporteRazon))
);
format(index, sizeof(index), "_report_%i", count);
SetPVarInt(playerid, index, i);
count++;
}
if(!count)
return SendClientMessage(playerid, 0xFFFFFFFF, "Nema aktivnih reportova!");
ShowPlayerDialog(playerid, 5, DIALOG_STYLE_TABLIST_HEADERS, "reportasq", string, "Pregledaj", "Cancel");
return 1;
}
stock GetPlayerNameEx(playerid)
{
new name;
GetPlayerName(playerid, name, sizeof(name));
return name;
}
stock cutMessage(str[])
{
new _str;
if(strlen(str) > 20)
{
format(_str, sizeof(_str), "%.20s ...", str);
}
else
{
format(_str, sizeof(_str), "%s", str);
}
return _str;
}