Points... -
iBots - 29.11.2013
i have scripted a points system for families and it keeps show me 4 erros on 1 line,the code for that line is:
if(Points[point][ClaimerId] != [INVALID_PLAYER_ID] || Points[point][TimeToClaim])
the errors:
C:\Users\John\Desktop\test\gamemodes\sarp.pwn(357) : error 029: invalid expression, assumed zero
C:\Users\John\Desktop\test\gamemodes\sarp.pwn(357) : warning 215: expression has no effect
C:\Users\John\Desktop\test\gamemodes\sarp.pwn(357) : error 001: expected token: ";", but found "]"
C:\Users\John\Desktop\test\gamemodes\sarp.pwn(357) : error 029: invalid expression, assumed zero
C:\Users\John\Desktop\test\gamemodes\sarp.pwn(357) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
4 Errors.
Re: Points... -
xVIP3Rx - 29.11.2013
next time use [Pawn] tags around the code
pawn Код:
if(Points[point][ClaimerId] != [INVALID_PLAYER_ID] || Points[point][TimeToClaim])
Can you show the Points enum ?
Also what about "Points[point][TimeToClaim]", What are you checking in it ?
Re: Points... -
Konstantinos - 29.11.2013
[INVALID_PLAYER_ID] is invalid, you need to use it as
INVALID_PLAYER_ID without the
[].
pawn Код:
if(Points[point][ClaimerId] != INVALID_PLAYER_ID || Points[point][TimeToClaim])
And keep in mind that
Points[point][TimeToClaim] would be correct if its value is not 0/false.
Re: Points... -
iBots - 29.11.2013
i have made the thing u gave me konsta...
[if(Points[point][ClaimerId] != INVALID_PLAYER_ID || Points[point][TimeToClaim])
it shows me:
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(377) : error 017: undefined symbol "PlayerInfo"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(379) : error 017: undefined symbol "GetPlayerNameEx"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(380) : error 017: undefined symbol "FamilyInfo"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(405) : error 017: undefined symbol "SetProgressBarValue"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(406) : error 017: undefined symbol "UpdateProgressBar"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(407) : error 017: undefined symbol "GetProgressBarValue"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(409) : error 017: undefined symbol "GetPlayerNameEx"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(413) : error 017: undefined symbol "GetProgressBarValue"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(415) : error 017: undefined symbol "SetProgressBarColor"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(416) : error 017: undefined symbol "UpdateProgressBar"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(41
: error 017: undefined symbol "GetProgressBarValue"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(420) : error 017: undefined symbol "SetProgressBarColor"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(421) : error 017: undefined symbol "UpdateProgressBar"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(423) : error 017: undefined symbol "GetProgressBarValue"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(427) : error 017: undefined symbol "DestroyProgressBar"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(433) : error 017: undefined symbol "DestroyProgressBar"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(1945) : error 001: expected token: "}", but found "-identifier-"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(1946) : error 010: invalid function or declaration
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(2005) : warning 201: redefinition of constant/macro (symbol "fPInfo")
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(2006) : error 021: symbol already defined: "Pointx"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(203
: error 021: symbol already defined: "Points"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(11583) : error 017: undefined symbol "playerTabbedTime"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(11583) : warning 215: expression has no effect
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(11583) : error 001: expected token: ";", but found "]"
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(11583) : error 029: invalid expression, assumed zero
C:\Users\John\Desktop\sar[2\gamemodes\sarp.pwn(11583) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
24 Errors.
when i put the [] around the invalid.... it shows only 4 errors
Re: Points... -
Konstantinos - 29.11.2013
You probably missed bracket(s) from the errors/warnings of the bottom. About the first, do you include progress to your script?
Post a part of the code close to lines 350-370.
Re: Points... -
iBots - 29.11.2013
enum fPInfo
{
Float:Pointx,
Float:Pointy,
Float:Pointz,
Type,
Vulnerable,
MatPoint,
CratePoint,
Announced,
ClaimerId,
ClaimerTeam,
TimeToClaim,
TimeLeft,
Owner[32],
PlayerNameCapping[MAX_PLAYER_NAME],
CapperName[MAX_PLAYER_NAME],
Name[32],
TakeOverTimerStarted,
TakeOverTimer,
Text3D:TextLabel,
CaptureTimerEx2,
Stock,
Text3D:CaptureProccess,
Text3D:CaptureProgress,
CaptureProccessEx,
Float: Capturex,
Float: Capturey,
Float: Capturez,
PointPickupID,
Bar:PointBarID,
}
new Points[MAX_POINTS][fPInfo];
my enums
Re: Points... -
Konstantinos - 29.11.2013
Not the enum, the part of code you used: if(Points[point][ClaimerId] != [INVALID_PLAYER_ID] || Points[point][TimeToClaim])
And also lines 1940-1950 because you miss a bracket there (probably).
Re: Points... -
iBots - 29.11.2013
pawn Код:
//===============================[Points Info]=====================================
enum fPInfo
{
Float:Pointx,
Float:Pointy,
Float:Pointz,
Type,
Vulnerable,
MatPoint,
CratePoint,
Announced,
ClaimerId,
ClaimerTeam,
TimeToClaim,
TimeLeft,
Owner[32],
PlayerNameCapping[MAX_PLAYER_NAME],
CapperName[MAX_PLAYER_NAME],
Name[32],
TakeOverTimerStarted,
TakeOverTimer,
Text3D:TextLabel,
CaptureTimerEx2,
Stock,
Text3D:CaptureProccess,
Text3D:CaptureProgress,
CaptureProccessEx,
Float: Capturex,
Float: Capturey,
Float: Capturez,
PointPickupID,
Bar:PointBarID,
}
new Points[MAX_POINTS][fPInfo];
//===============================[Points]=======================================
public CaptureTimer(point)
{
new string[128];
new fam;
if(Points[point][TimeToClaim])
{
new claimer = Points[point][ClaimerId];
new Float: x, Float: y, Float: z;
GetPlayerPos(claimer, x, y, z);
if (Points[point][Capturex] != x || Points[point][Capturey] != y || Points[point][Capturez] != z || GetPVarInt(Points[point][ClaimerId],"Injured") == 1)
{
SendClientMessage(Points[point][ClaimerId], COLOR_LIGHTBLUE, "You failed to capture. You either moved or died while attempting to capture.");
Points[point][ClaimerId] = INVALID_PLAYER_ID;
Points[point][TimeToClaim] = 0;
}
else
{
if(Points[point][Vulnerable] > 0)
{
SendClientMessage(Points[point][ClaimerId], COLOR_LIGHTBLUE, "You failed to capture. The point was already captured.");
Points[point][ClaimerId] = INVALID_PLAYER_ID;
Points[point][TimeToClaim] = 0;
return 1;
}
if(PlayerInfo[claimer][pFMember] == 255)
{
Points[point][PlayerNameCapping] = GetPlayerNameEx(claimer);
format(string, sizeof(string), "%s has attempted to take control of the %s for %s, it will be theirs in %d minutes.", Points[point][PlayerNameCapping], Points[point][Name], FamilyInfo[fam][FamilyName], TIME_TO_TAKEOVER);
SendClientMessageToAll(COLOR_YELLOW, string);
}
if(Points[point][CaptureProccessEx] >= 1)
{
UpdateDynamic3DTextLabelText(Points[point][CaptureProccess], COLOR_YELLOW, string);
Points[point][CaptureProccessEx] = 2;
}
Points[point][TakeOverTimerStarted] = 1;
Points[point][TakeOverTimer] = 10;
Points[point][ClaimerId] = INVALID_PLAYER_ID;
Points[point][ClaimerTeam] = fam;
Points[point][TimeToClaim] = 0;
if(Points[point][CaptureTimerEx2] != -1) KillTimer(Points[point][CaptureTimerEx2]);
Points[point][CaptureTimerEx2] = SetTimerEx("CaptureTimerEx", 60000, 1, "d", point);
}
}
return 1;
}
public ProgressTimer(point)
{
if (Points[point][ClaimerId] != INVALID_PLAYER_ID && Points[point][TimeToClaim])
{
Points[point][TimeLeft]--;
SetProgressBarValue(Points[point][PointBarID], GetProgressBarValue(Points[point][PointBarID])-10.0);
UpdateProgressBar(Points[point][PointBarID], Points[point][ClaimerId]);
if(GetProgressBarValue(Points[point][PointBarID]) >= 10) SetTimerEx("ProgressTimer", 1000, 0, "d", point);
new string[128];
format(string, sizeof(string), "%s is attempting to capture the point, time left: %d", GetPlayerNameEx(Points[point][ClaimerId]), Points[point][TimeLeft]);
if(Points[point][TimeLeft] == 9) Points[point][CaptureProgress] = CreateDynamic3DTextLabel(string, COLOR_RED, Points[point][Pointx], Points[point][Pointy], Points[point][Pointz]+1.0, 10.0);
else if(Points[point][TimeLeft] < 9 && Points[point][TimeLeft] >= 0) UpdateDynamic3DTextLabelText(Points[point][CaptureProgress], COLOR_RED, string);
if(GetProgressBarValue(Points[point][PointBarID]) == 50.0)
{
SetProgressBarColor(Points[point][PointBarID], COLOR_YELLOW);
UpdateProgressBar(Points[point][PointBarID], Points[point][ClaimerId]);
}
else if(GetProgressBarValue(Points[point][PointBarID]) == 20.0)
{
SetProgressBarColor(Points[point][PointBarID], COLOR_RED);
UpdateProgressBar(Points[point][PointBarID], Points[point][ClaimerId]);
}
else if(GetProgressBarValue(Points[point][PointBarID]) <= 0.0 && Points[point][TimeLeft] <= 0)
{
CaptureTimer(point);
Points[point][TimeLeft] = 0;
DestroyProgressBar(Points[point][PointBarID]);
DestroyDynamic3DTextLabel(Points[point][CaptureProgress]);
}
}
else
{
DestroyProgressBar(Points[point][PointBarID]);
DestroyDynamic3DTextLabel(Points[point][CaptureProgress]);
Points[point][ClaimerId] = INVALID_PLAYER_ID;
Points[point][TimeToClaim] = 0;
}
return 1;
}
Re: Points... -
iBots - 29.11.2013
these are under the enum
Re: Points... -
iBots - 29.11.2013
help?