091 Error. - 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: 091 Error. (
/showthread.php?tid=298719)
091 Error. -
remyguys - 22.11.2011
This is the error:
error 091: ambiguous constant; tag override is required (symbol "X")
Thanks in Advance!
PHP код:
if(strcmp(cmd, "/fbiduty", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pFaction] != 255 && DynamicFactions[PlayerInfo[playerid][pFaction]][fType] == 2)
{
if (PlayerToPoint(5.0, playerid,fbidutyposition[X],fbidutyposition[Y],fbidutyposition[Z])) //This is the line that gives the error.
{
if(GetPlayerVirtualWorld(playerid) == fbidutyposition[World])
{
if(CopOnDuty[playerid] == 0)
{
if(PlayerInfo[playerid][pSex] == 1)
{
PlayerActionMessage(playerid,15.0,"clocks in , and takes his stuff from the locker.");
}
else
{
PlayerActionMessage(playerid,15.0,"clocks in , and takes her stuff from the locker.");
}
GivePlayerWeapon(playerid, 24, 70);
GivePlayerWeapon(playerid, 3, 0);
GivePlayerWeapon(playerid, 41, 700);
CopOnDuty[playerid] = 1;
SetPlayerToFactionSkin(playerid);
SetPlayerToFactionColor(playerid);
format(string, sizeof(string), "[FBI:] %s is now an on duty.",GetPlayerNameEx(playerid));
SendFactionTypeMessage(1, COLOR_LSPD, string);
return 1;
}
else
{
if(PlayerInfo[playerid][pSex] == 1)
{
PlayerActionMessage(playerid,15.0,"%s clocks out, and puts his stuff in the locker.");
}
else
{
PlayerActionMessage(playerid,15.0,"%sclocks out, and puts her stuff in the locker.");
}
ResetPlayerWeapons(playerid);
CopOnDuty[playerid] = 0;
SetPlayerToFactionSkin(playerid);
SetPlayerToFactionColor(playerid);
return 1;
}
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] You are not at the duty position!");
return 1;
}
}
else
{
SendClientMessage(playerid, COLOR_LIGHTYELLOW2, "[ERROR:] Invalid Faction/Type.");
return 1;
}
}
return 1;
}
Re: 091 Error. -
JaTochNietDan - 22.11.2011
I haven't seen that error before, but it would seem to mean that "X" is ambiguous and the compiler doesn't know which one you're referring to.
Try using a different variable name for X, such as fX.
If that doesn't help, can you show us your declaration of "fbidutyposition" and the "X,Y,Z" variables?
Re: 091 Error. -
remyguys - 22.11.2011
Tbh im not sure where i can find my declaration, but it uses the file fbidutyposition.cfg
246.674500|125.841600|1003.218800|1|3|176.314700
Thats the only line in it.
PHP код:
public Loadfbidutyposition()
{
new arrCoords[6][64];
new strFromFile2[256];
new File: file = fopen("CRP_Scriptfiles/Locations/fbidutyposition.cfg", io_read);
if (file)
{
fread(file, strFromFile2);
split(strFromFile2, arrCoords, '|');
fbidutyposition[X] = floatstr(arrCoords[0]);
fbidutyposition[Y] = floatstr(arrCoords[1]);
fbidutyposition[Z] = floatstr(arrCoords[2]);
fbidutyposition[World] = strval(arrCoords[3]);
fbidutyposition[Interior] = strval(arrCoords[4]);
fbidutyposition[Angle] = floatstr(arrCoords[5]);
print("[INFO:] Fbi Duty location loaded.");
}
fclose(file);
return 1;
}