Liebe Community,
Ich bekomme Errors (mal wieder...) und ich weis nicht wie ich "idx" ersetzen soll und was der Error mit dem string meint.
Die Errors:
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(2842) : warning 208: function with tag result used before definition, forcing reparse
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1527) : error 017: undefined symbol "idx"
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1529) : error 017: undefined symbol "idx"
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1529) : warning 215: expression has no effect
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1531) : error 017: undefined symbol "idx"
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1533) : error 017: undefined symbol "idx"
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1535) : error 017: undefined symbol "idx"
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1536) : error 017: undefined symbol "idx"
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1536) : warning 215: expression has no effect
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1538) : error 017: undefined symbol "idx"
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1546) : error 017: undefined symbol "string"
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1546) : error 017: undefined symbol "string"
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1546) : error 029: invalid expression, assumed zero
C:\- GTA (SA) LoR Server -\gamemodes\LoR-v1.pwn(1546) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
11 Errors.
Die Zeilen:
if(strcmp("/departments", cmdtext, true, 12) == 0 || strcmp("/d", cmdtext, true, 2) == 0)
{
if(IsPlayerConnected(playerid))
{
new sendername[32];
GetPlayerName(playerid, sendername, sizeof(sendername));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_HGRAD, "Benutze: (/d)epartments [Text]");
return 1;
}
if(sSpieler[playerid][fMitglied] == 1 || sSpieler[playerid][Leader] == 1)
{
if(sSpieler[playerid][Rang] == 15) { format(string, sizeof(string), "** Chief of Police %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 14) { format(string, sizeof(string), "** Assistant Chief %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 13) { format(string, sizeof(string), "** Deputy Chief %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 12) { format(string, sizeof(string), "** Commander %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 11) { format(string, sizeof(string), "** Captain %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 10) { format(string, sizeof(string), "** Lieutenant %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 9) { format(string, sizeof(string), "** Sergeant II %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 8) { format(string, sizeof(string), "** Sergeant I %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 7) { format(string, sizeof(string), "** Detective III %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 6) { format(string, sizeof(string), "** Detective II %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 5) { format(string, sizeof(string), "** Detective I %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 4) { format(string, sizeof(string), "** Police Officer II %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 3) { format(string, sizeof(string), "** Police Officer I %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 2) { format(string, sizeof(string), "** Traffic Officer %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 1) { format(string, sizeof(string), "** Cadet %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Suspendiert %s: %s, over. **", sendername, result);
}
DepartmentLeaderMessage(playerid, COLOR_ALLDEPT, string);
DepartmentMemberMessage(playerid, COLOR_ALLDEPT, string);
printf("%s", string);
return 1;
}
else if(sSpieler[playerid][fMitglied] == 2 || sSpieler[playerid][Leader] == 2)
{
if(sSpieler[playerid][Rang] == 15) { format(string, sizeof(string), "** S.W.A.T. Chief %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 14) { format(string, sizeof(string), "** S.W.A.T. Assistant Chief %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 13) { format(string, sizeof(string), "** S.W.A.T. Deputy Chief %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 12) { format(string, sizeof(string), "** S.W.A.T. Commander %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 11) { format(string, sizeof(string), "** S.W.A.T. Captain %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 10) { format(string, sizeof(string), "** S.W.A.T. Elite Officer %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 9) { format(string, sizeof(string), "** S.W.A.T. Special Officer %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 8) { format(string, sizeof(string), "** S.W.A.T. Agent %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 7) { format(string, sizeof(string), "** S.W.A.T. Officer IIII %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 6) { format(string, sizeof(string), "** S.W.A.T. Officer III %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 5) { format(string, sizeof(string), "** S.W.A.T. Officer II %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 4) { format(string, sizeof(string), "** S.W.A.T. Officer I %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 3) { format(string, sizeof(string), "** S.W.A.T. Trainee %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 2) { format(string, sizeof(string), "** S.W.A.T. Recruit %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 1) { format(string, sizeof(string), "** S.W.A.T. Cadet %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Suspendiert %s: %s, over. **", sendername, result);
}
DepartmentLeaderMessage(playerid, COLOR_ALLDEPT, string);
DepartmentMemberMessage(playerid, COLOR_ALLDEPT, string);
printf("%s", string);
return 1;
}
else if(sSpieler[playerid][fMitglied] == 3 || sSpieler[playerid][Leader] == 3)
{
if(sSpieler[playerid][Rang] == 15) { format(string, sizeof(string), "** Director %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 14) { format(string, sizeof(string), "** Assistant Director %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 13) { format(string, sizeof(string), "** Deouty Director %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 12) { format(string, sizeof(string), "** Unit Chief %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 11) { format(string, sizeof(string), "** Resident Agent %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 10) { format(string, sizeof(string), "** Elite Agent in Charge %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 9) { format(string, sizeof(string), "** Special Agent in Charge %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 8) { format(string, sizeof(string), "** Assistant Special Agent in Charge %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 7) { format(string, sizeof(string), "** Supervisory Special Agent %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 6) { format(string, sizeof(string), "** Special Agent %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 5) { format(string, sizeof(string), "** Prof. Agent %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 4) { format(string, sizeof(string), "** Prof. Assistant Agent %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 3) { format(string, sizeof(string), "** Agent %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 2) { format(string, sizeof(string), "** New Agent %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 1) { format(string, sizeof(string), "** New Agent in Trainee %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Private %s: %s, over. **", sendername, result);
}
DepartmentLeaderMessage(playerid, COLOR_ALLDEPT, string);
DepartmentMemberMessage(playerid, COLOR_ALLDEPT, string);
printf("%s", string);
return 1;
}
else if(sSpieler[playerid][fMitglied] == 4 || sSpieler[playerid][Leader] == 4)
{
if(sSpieler[playerid][Rang] == 15) { format(string, sizeof(string), "** General of the Army %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 14) { format(string, sizeof(string), "** General %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 13) { format(string, sizeof(string), "** Lieutenant General %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 12) { format(string, sizeof(string), "** Major General %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 11) { format(string, sizeof(string), "** Brigadier General %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 10) { format(string, sizeof(string), "** Colonel %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 9) { format(string, sizeof(string), "** Lieutenant Colonel %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 8) { format(string, sizeof(string), "** Major %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 7) { format(string, sizeof(string), "** Captain of the Army %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 6) { format(string, sizeof(string), "** First Lieutenant %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 5) { format(string, sizeof(string), "** Second Lieutenant %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 4) { format(string, sizeof(string), "** Chief Warrant Officer %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 3) { format(string, sizeof(string), "** Warrant Officer %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 2) { format(string, sizeof(string), "** Private First Class %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 1) { format(string, sizeof(string), "** Private %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Private %s: %s, over. **", sendername, result);
}
DepartmentLeaderMessage(playerid, COLOR_ALLDEPT, string);
DepartmentMemberMessage(playerid, COLOR_ALLDEPT, string);
printf("%s", string);
return 1;
}
else if(sSpieler[playerid][fMitglied] == 5 || sSpieler[playerid][Leader] == 5)
{
if(sSpieler[playerid][Rang] == 10) { format(string, sizeof(string), "** Zolldirector %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 9) { format(string, sizeof(string), "** Assistant Zolldirector %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 8) { format(string, sizeof(string), "** Deputy Zolldirector %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 7) { format(string, sizeof(string), "** Leitender Zollausbilder %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 6) { format(string, sizeof(string), "** Zollausbilder %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 5) { format(string, sizeof(string), "** Zollbeamter II %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 4) { format(string, sizeof(string), "** Zollbeamter I %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 3) { format(string, sizeof(string), "** Zollbeamter %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 2) { format(string, sizeof(string), "** Lehrling des Zolls %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 1) { format(string, sizeof(string), "** Praktikant des Zolls %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Private %s: %s, over. **", sendername, result);
}
DepartmentLeaderMessage(playerid, COLOR_ALLDEPT, string);
DepartmentMemberMessage(playerid, COLOR_ALLDEPT, string);
printf("%s", string);
return 1;
}
else if(sSpieler[playerid][fMitglied] == 6 || sSpieler[playerid][Leader] == 6)
{
if(sSpieler[playerid][Rang] == 10) { format(string, sizeof(string), "** Ordnungsamtleiter %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 9) { format(string, sizeof(string), "** Stellv. Ordnungsamtleiter %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 8) { format(string, sizeof(string), "** Ordnungsamt Vorstand %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 7) { format(string, sizeof(string), "** Stellv. Ordnungsamt Vorstand %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 6) { format(string, sizeof(string), "** Ordnungsamt Beobachter %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 5) { format(string, sizeof(string), "** Ordnungsamt Geselle %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 4) { format(string, sizeof(string), "** Ordnungshüter %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 3) { format(string, sizeof(string), "** Politesse %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 2) { format(string, sizeof(string), "** Ordnungsamt Lehrling %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 1) { format(string, sizeof(string), "** Ordnungsamt Praktikant %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Private %s: %s, over. **", sendername, result);
}
DepartmentLeaderMessage(playerid, COLOR_ALLDEPT, string);
DepartmentMemberMessage(playerid, COLOR_ALLDEPT, string);
printf("%s", string);
return 1;
}
else if(sSpieler[playerid][fMitglied] == 7 || sSpieler[playerid][Leader] == 7)
{
if(sSpieler[playerid][Rang] == 15) { format(string, sizeof(string), "** Firepresident %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 14) { format(string, sizeof(string), "** Assistant Firepresident %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 13) { format(string, sizeof(string), "** Deputy Firepresident %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 12) { format(string, sizeof(string), "** Major Firefighter %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 11) { format(string, sizeof(string), "** Brigadier Firefighter %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 10) { format(string, sizeof(string), "** Firefighter Captain %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 9) { format(string, sizeof(string), "** Firefighter Colonel %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 8) { format(string, sizeof(string), "** Firefighter Lieutenant %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 7) { format(string, sizeof(string), "** Firefighter %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 6) { format(string, sizeof(string), "** Assistant Firefighter %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 5) { format(string, sizeof(string), "** Chefarzt %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 4) { format(string, sizeof(string), "** Oberarzt %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 3) { format(string, sizeof(string), "** Arzt %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 2) { format(string, sizeof(string), "** Notarzt %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 1) { format(string, sizeof(string), "** Rettungssanitäter %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Private %s: %s, over. **", sendername, result);
}
DepartmentLeaderMessage(playerid, COLOR_ALLDEPT, string);
DepartmentMemberMessage(playerid, COLOR_ALLDEPT, string);
printf("%s", string);
return 1;
}
else if(sSpieler[playerid][fMitglied] == 8 || sSpieler[playerid][Leader] == 8)
{
if(sSpieler[playerid][Rang] == 15) { format(string, sizeof(string), "** U.S. President %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 14) { format(string, sizeof(string), "** U.S. Vice President %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 13) { format(string, sizeof(string), "** U.S. Kanzler %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 12) { format(string, sizeof(string), "** U.S. Vice Kanzler %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 11) { format(string, sizeof(string), "** U.S. Bundesminister %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 10) { format(string, sizeof(string), "** U.S. Landesminister L.V. %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 9) { format(string, sizeof(string), "** U.S. Landesminister S.F. %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 8) { format(string, sizeof(string), "** U.S. Landesminister L.S. %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 7) { format(string, sizeof(string), "** U.S. Außenminister %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 6) { format(string, sizeof(string), "** U.S. Innenminister %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 5) { format(string, sizeof(string), "** U.S. Verteidigungsminister %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 4) { format(string, sizeof(string), "** U.S. Finanzminister %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 3) { format(string, sizeof(string), "** U.S. Gesundheitsminister %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 2) { format(string, sizeof(string), "** U.S. Staatsanwalt %s: %s, over. **", sendername, result); }
else if(sSpieler[playerid][Rang] == 1) { format(string, sizeof(string), "** U.S. Abgeordneter %s: %s, over. **", sendername, result); }
else
{
format(string, sizeof(string), "** Private %s: %s, over. **", sendername, result);
}
DepartmentLeaderMessage(playerid, COLOR_ALLDEPT, string);
DepartmentMemberMessage(playerid, COLOR_ALLDEPT, string);
printf("%s", string);
return 1;
}
else
{
SendClientMessage(playerid, COLOR_HGRAD, "Du hast nicht die Befugnis.");
return 1;
}
}
return 1;
}