091 Error.
#1

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.0playerid,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(playerid2470);
                            
GivePlayerWeapon(playerid30);
                            
GivePlayerWeapon(playerid41700);
                            
CopOnDuty[playerid] = 1;
                            
SetPlayerToFactionSkin(playerid);
                            
SetPlayerToFactionColor(playerid);
                            
format(stringsizeof(string), "[FBI:] %s is now an on duty.",GetPlayerNameEx(playerid));
                            
SendFactionTypeMessage(1COLOR_LSPDstring);
                            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(playeridCOLOR_LIGHTYELLOW2"[ERROR:] You are not at the duty position!");
                    return 
1;
                }
            }
               else
            {
                
SendClientMessage(playeridCOLOR_LIGHTYELLOW2"[ERROR:] Invalid Faction/Type.");
                return 
1;
            }
        }
        return 
1;
    } 
Reply
#2

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?
Reply
#3

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 
Filefile fopen("CRP_Scriptfiles/Locations/fbidutyposition.cfg"io_read);
    if (
file)
    {
        
fread(filestrFromFile2);
        
split(strFromFile2arrCoords'|');
        
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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)