Errors - 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: Errors (
/showthread.php?tid=579979)
Errors -
PowerF - 01.07.2015
Код:
F:\Project\pawno\include\SmartAFKTabbing.inc(142) : error 076: syntax error in the expression, or invalid function call
F:\Project\Gamemode\Innovative.pwn(12282) : error 017: undefined symbol "foreach"
F:\Project\Gamemode\Innovative.pwn(12282) : error 029: invalid expression, assumed zero
F:\Project\Gamemode\Innovative.pwn(12282) : error 017: undefined symbol "i"
F:\Project\Gamemode\Innovative.pwn(12282) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
Код:
public OnPlayerDisconnect(playerid, reason)
{
new reasonMsg[25], leaveMsg[128], name[MAX_PLAYER_NAME];
switch(reason)
{
case 0: reasonMsg = "Timeout";
case 1: reasonMsg = "Leaving";
case 2: reasonMsg = "Kicked/Banned";
}
if(InRace[playerid] != -1) LeaveRace(playerid);
SendClientMessageToAllEx(-1,""WHITE"%s[%d] has left the server. (%s)", GetName(playerid), playerid, reasonMsg);
SetPlayerColor(playerid, 0xFFFFFFFF);
SendDeathMessage(INVALID_PLAYER_ID,playerid,201);
SetPlayerColor(playerid, PlayerInfo[playerid][Color]);
GetPlayerName(playerid, name, sizeof(name));
format(leaveMsg, sizeof(leaveMsg), "04***[LEAVE] 01%s[%d] has left the server. (%s)", name, playerid, reasonMsg);
IRC_GroupSay(groupID, IRC_CHANNEL, leaveMsg);
IRC_GroupSay(groupIDA, IRC_ADMIN_CHANNEL, leaveMsg);
DestroyVehicle(playerPV[playerid]);
DestroyDynamic3DTextLabel(playerPVLabel[playerid]);
if(PVeh[playerid] != INVALID_VEHICLE_ID)
{
DestroyVehicle(PVeh[playerid]);
PVeh[playerid] = INVALID_VEHICLE_ID;
}
KillTimer(nitroUseTimer[playerid]);
KillTimer(nitroReloadTimer[playerid]);
DestroyPlayerProgressBar(playerid, nitrobar[playerid]);
if(GetPVarInt(playerid, "Reconnecting") == 1)
{
new iStr[30], iP[16];
GetPVarString(playerid, "RecIP", iP, sizeof(iP));
format(iStr, sizeof(iStr), "unbanip %s", iP);
SendRconCommand(iStr);
SendRconCommand("reloadbans");
SetPVarInt(playerid, "Reconnecting", 0);
}
if(IsBeingSpeced[playerid] == 1)
foreach(Player,i)
if(spectatorid[i] == playerid)
TogglePlayerSpectating(i,false);
if(incbug[playerid] == 1)
incbug[playerid] = 0;
foreach(new i : Player)
if(LastSender[i] == playerid)
LastSender[i] = -1;
SaveStatus(playerid);
return 1;
}
can someone help me?i already include foreach
Re : Errors -
Terrorizt - 01.07.2015
Did you #include <foreach> ?
Re: Errors -
PowerF - 01.07.2015
Yes i did,i already edit my post,check the codes.
Re: Errors -
nezo2001 - 01.07.2015
foreach should has
Re: Errors -
PowerF - 01.07.2015
Quote:
Originally Posted by nezo2001
|
What do you mean?
Re: Errors -
nezo2001 - 01.07.2015
PHP код:
if(IsBeingSpeced[playerid] == 1)
{
foreach(Player,i)
{
if(spectatorid[i] == playerid)
{
TogglePlayerSpectating(i,false);
}
}
}
All should be like this and IF statments also
Re: Errors -
Suicidal.Banana - 01.07.2015
He means that your foreach doesnt have swirly brackets, at least not in the example code you provided.
BAD:
Код:
foreach(...)
... magical foreach code ...
GOOD:
Код:
foreach(...) {
... magical foreach code ...
}
note the added
{ and
}
Re: Errors -
PowerF - 01.07.2015
Код:
foreach(new i : Player)
if(LastSender[i] == playerid)
LastSender[i] = -1;
the problem is in there
Re: Errors -
nezo2001 - 01.07.2015
as I said
PHP код:
foreach(new i : Playerid)
{
if(LastSender[i] == playerid) return LastSender[i] = -1;
}
or
PHP код:
foreach(new i : Playerid)
{
if(LastSender[i] == playerid)
{
LastSender[i] = -1;
}
}
All are same
Re: Errors -
PowerF - 01.07.2015
Still
Код:
F:\Project\pawno\include\SmartAFKTabbing.inc(142) : error 076: syntax error in the expression, or invalid function call
F:\Project\Gamemode\Innovative.pwn(12288) : warning 217: loose indentation
F:\Project\Gamemode\Innovative.pwn(12288) : error 017: undefined symbol "foreach"
F:\Project\Gamemode\Innovative.pwn(12288) : error 029: invalid expression, assumed zero
F:\Project\Gamemode\Innovative.pwn(12288) : error 017: undefined symbol "i"
F:\Project\Gamemode\Innovative.pwn(12288) : fatal error 107: too many error messages on one line