help in stocks -
Youice - 08.03.2012
hello here is my hex code of my stock for /report s.
Код:
stock SendReportToPlayer(reportfrom, report[])
{
new bool:breakingloop = false, newid = INVALID_REPORT_ID;
for(new i=0;i<MAX_REPORTS;i++)
{
if(!breakingloop)
{
if(Reports[i][HasBeenUsed] == 0)
{
breakingloop = true;
newid = i;
}
}
}
if(newid != INVALID_REPORT_ID)
{
strmid(Reports[newid][Report], report, 0, strlen(report), 128);
Reports[newid][ReportFrom] = reportfrom;
Reports[newid][TimeToExpire] = 5;
Reports[newid][HasBeenUsed] = 1;
Reports[newid][BeingUsed] = 1;
Reports[newid][ReportExpireTimer] = SetTimer("ReportTimer", 60000, 0, "d", newid); //2 warnings here
new string[128];
format(string, sizeof(string), "Report from [%i] %s (RID: %i): %s", reportfrom, GetPlayerName(reportfrom), newid, (report)); //2 warnings here
ABroadCast(COLOR_REPORT,string,2);
}
else
{
ClearReports();
SendReportToQue(reportfrom, report);
}
if(PlayerInfo[reportfrom][pDonateRank] == 4)
{
new string[128];
format(string, sizeof(string), "~r~Priority Report: ~g~%d", newid);
foreach(Player, i)
{
if(PlayerInfo[i][AdminLevel] >= 2)
{
GameTextForPlayer(i, string, 1500, 1);
}
}
}
}
here are the warnings:
Код:
C:\Users\BCC\Desktop\ZMRP\gamemodes\TEST.pwn(1768) : warning 202: number of arguments does not match definition
C:\Users\BCC\Desktop\ZMRP\gamemodes\TEST.pwn(1768) : warning 202: number of arguments does not match definition
C:\Users\BCC\Desktop\ZMRP\gamemodes\TEST.pwn(1770) : warning 202: number of arguments does not match definition
C:\Users\BCC\Desktop\ZMRP\gamemodes\TEST.pwn(1770) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Warnings.
Re: help in stocks -
SpiritEvil - 08.03.2012
On which lines are you getting the warnings?
Re: help in stocks -
Youice - 08.03.2012
I have putted " //2 warnings here " in every warning I have! see carefully
Re: help in stocks -
SpiritEvil - 08.03.2012
Oh sorry my bad, I didn't see them, anyways try these:
pawn Код:
Reports[newid][ReportExpireTimer] = SetTimerEx("ReportTimer", 60000, 0, "d", newid);
format(string, sizeof(string), "Report from [%i] %s (RID: %i): %s", reportfrom, GetPlayerName(reportfrom), newid, report);
Re: help in stocks -
Youice - 08.03.2012
Thanks for helping but still 2 warnings
Код:
C:\Users\BCC\Desktop\ZMRP\gamemodes\TEST.pwn(1771) : warning 202: number of arguments does not match definition
C:\Users\BCC\Desktop\ZMRP\gamemodes\TEST.pwn(1771) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Warnings.
here is the code
Код:
//==============================================================================
stock SendReportToQue(reportfrom, report[])
{
new bool:breakingloop = false, newid = INVALID_REPORT_ID;
for(new i=0;i<MAX_REPORTS;i++)
{
if(!breakingloop)
{
if(Reports[i][HasBeenUsed] == 0)
{
breakingloop = true;
newid = i;
}
}
}
if(newid != INVALID_REPORT_ID)
{
strmid(Reports[newid][Report], report, 0, strlen(report), 128);
Reports[newid][ReportFrom] = reportfrom;
Reports[newid][TimeToExpire] = 5;
Reports[newid][HasBeenUsed] = 1;
Reports[newid][BeingUsed] = 1;
Reports[newid][ReportExpireTimer] = SetTimerEx("ReportTimer", 60000, 0, "d", newid); // the 2 warnings are here
new string[128];
format(string, sizeof(string), "Report from [%i] %s (RID: %i): %s", reportfrom, GetPlayerName(reportfrom), newid, report);
ABroadCast(COLOR_REPORT,string,2);
}
else
{
ClearReports();
SendReportToQue(reportfrom, report);
}
if(PlayerInfo[reportfrom][pDonateRank] == 4)
{
new string[128];
format(string, sizeof(string), "~r~Priority Report: ~g~%d", newid);
foreach(Player, i)
{
if(PlayerInfo[i][AdminLevel] >= 2)
{
GameTextForPlayer(i, string, 1500, 1);
}
}
}
}
Re: help in stocks -
SpiritEvil - 08.03.2012
I'm not sure if this is gonna fix it (actually I'm almost sure it wont :P), but anyway worth giving it a try:
pawn Код:
Reports[newid][ReportExpireTimer] = SetTimerEx("ReportTimer", 60000, false, "d", newid);
If it doesn't then I don't know what is causing the warning. It seems correct to me though.
Re: help in stocks -
Youice - 08.03.2012
nice try but as if nothing happen to the 2 warnings any way thank you very much , bro
Re: help in stocks -
SpiritEvil - 08.03.2012
Also can you show the Reports enum and the ReportTimer function as they might be the cause of the warning.
Re: help in stocks -
Youice - 08.03.2012
well okay here is the enum
Код:
enum reportinfo
{
HasBeenUsed,
Report[128],
ReportFrom,
CheckingReport,
TimeToExpire,
BeingUsed,
ReportExpireTimer,
ReplyTimerr
}
Re: help in stocks -
SpiritEvil - 08.03.2012
Mind checking again the line where you are getting the warnings from? I tried to compile your script and it was giving the warnings on the format line.