warns - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: warns (
/showthread.php?tid=557257)
warns -
Rabea - 13.01.2015
hello, its giving me warns, what is the problem?
pawn Код:
if(tmin == 0 && tsec <= 4 && PayChecks == 0)
{
SetWorldTime(thour);
Paycheck();
// Points
for(new idx = 0; idx<MAX_POINTS; idx++)
{
PointBC[idx] = 0;
}
for(new idx = 0; idx < MAX_POINTS; idx++)
{
if(PointInfo[idx][pTime]) PointInfo[idx][pTime] --;
if(!PointInfo[idx][pTime] && !PointBC[idx])
{
PointInfo[idx][pOwner] = 0;
PointInfo[idx][pProfit] = 0;
/////format(string, sizeof(string), "The %s is available to be captured.", PointInfo[idx][pName]);
//SendClientMessageToAll(COLOR_YELLOW, string);
DestroyDynamicPickup(PointInfo[idx][pPickup]);
DestroyDynamic3DTextLabel(PointInfo[idx][pText]);
PointInfo[idx][pPickup] = CreateDynamicPickup(1239, 1, PointInfo[idx][pX], PointInfo[idx][pY], PointInfo[idx][pZ]);
PointInfo[idx][pText] = CreateDynamic3DTextLabel("Point\n/capture", COLOR_WHITE, PointInfo[idx][pX], PointInfo[idx][pY], PointInfo[idx][pZ]+0.3, 15);
}
new playerid; // this line 48314
if(IsACop(playerid) && IsAFBI(playerid) && IsAGov(playerid) && IsAHSF(playerid) && IsAARMY(playerid) && IsASATF(playerid))
return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You recived $10,000 for law job.");
GiveZaiatMoney(playerid, 10000);
}
return 1; // this line 48319
}
} // this line 48321
pawn Код:
(48314) : warning 217: loose indentation
(48319) : warning 217: loose indentation
(48321) : warning 209: function "Clock" should return a value
any idea?
Re: warns -
PowerPC603 - 13.01.2015
The first 2 warnings indicate a problem with your indentation.
You should have all your brackets right under your if/for/switch statements, not indented yet.
The last one: just add "return 1;" right before the closing bracket of your function.
pawn Код:
Clock()
{
if(tmin == 0 && tsec <= 4 && PayChecks == 0)
{
SetWorldTime(thour);
Paycheck();
// Points
for(new idx = 0; idx<MAX_POINTS; idx++)
{
PointBC[idx] = 0;
}
for(new idx = 0; idx < MAX_POINTS; idx++)
{
if(PointInfo[idx][pTime]) PointInfo[idx][pTime] --;
if(!PointInfo[idx][pTime] && !PointBC[idx])
{
PointInfo[idx][pOwner] = 0;
PointInfo[idx][pProfit] = 0;
/////format(string, sizeof(string), "The %s is available to be captured.", PointInfo[idx][pName]);
//SendClientMessageToAll(COLOR_YELLOW, string);
DestroyDynamicPickup(PointInfo[idx][pPickup]);
DestroyDynamic3DTextLabel(PointInfo[idx][pText]);
PointInfo[idx][pPickup] = CreateDynamicPickup(1239, 1, PointInfo[idx][pX], PointInfo[idx][pY], PointInfo[idx][pZ]);
PointInfo[idx][pText] = CreateDynamic3DTextLabel("Point\n/capture", COLOR_WHITE, PointInfo[idx][pX], PointInfo[idx][pY], PointInfo[idx][pZ]+0.3, 15);
}
new playerid; // this line 48314
if(IsACop(playerid) && IsAFBI(playerid) && IsAGov(playerid) && IsAHSF(playerid) && IsAARMY(playerid) && IsASATF(playerid))
return SendClientMessage(playerid, COLOR_LIGHTBLUE, "You recived $10,000 for law job.");
GiveZaiatMoney(playerid, 10000);
}
}
return 1;
}