if(strcmp(cmd, "/duty", true) == 0)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1492.6821,1307.9697,1093.2931))
{
if(IsAnInstructor(playerid))
{
if(FahrlehrerDuty[playerid] == 0)
{
SetPlayerToTeamColor(playerid);
new name[MAX_PLAYER_NAME];
new string[128];//Error Zeile
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "Fahrlehrer %s ist nun im Dienst, Nummmer: %d", name,PlayerInfo[playerid][pPnumber]);
SendClientMessageToAll(COLOR_RED, string);//Käsesahne
FahrlehrerDuty[playerid] = 1;
return 1;
}
else if(FahrlehrerDuty[playerid] == 1)
{
new name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, name2, sizeof(name2));
new string2[128];
format(string2, sizeof(string2), "Fahrlehrer %s ist nun nicht mehr im Dienst", name2);
SendClientMessageToAll(COLOR_RED, string2);
SetPlayerColor(playerid,COLOR_WHITE);
FahrlehrerDuty[playerid] = 0;
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, "Du bist kein Fahrlehrer.");
}
}
return 1;
}
Error:
C:\Dokumente und Einstellungen\Kais\Desktop\samp03dsvr_R2_win32\gamemodes\myscript.pwn(22874) : warning 219: local variable "string" shadows a variable at a preceding level