Quick help
#1

I get lot of tag mismatch errors on these lines
Код:
public ChangeStreamPickupModel(ID,newmodel)
{
    if(Pickup[ID][pickupCreated])
	{
	    DestroyPickup(Pickup[ID][pickupID]);
	    Pickup[ID][pickupVisible] = 0;
		Pickup[ID][pickupModel] = newmodel;
		return 1;
	}
	return 0;
}
public MoveStreamPickup(ID,Float:x,Float:y,Float:z)
{
	if(Pickup[ID][pickupCreated])
	{
	    DestroyPickup(Pickup[ID][pickupID]);
	    Pickup[ID][pickupVisible] = 0;
		Pickup[ID][pickupX] = x;
		Pickup[ID][pickupY] = y;
		Pickup[ID][pickupZ] = z;
		return 1;
	}
	return 0;
}
public CreateStreamPickup(model,type,Float:x,Float:y,Float:z,range)
{
	new FoundID = 0;
	new ID;

	for ( new i = 0; FoundID <= 0 ; i++)
	{
	    if( Pickup[i][pickupCreated] == 0 )
	    {
	        if( FoundID == 0 )
	        {
	     	   ID = i;
	     	   FoundID = 1;
	        }
	    }
	    if( i > MAX_S_PICKUPS )
	    {
		    FoundID = 2;
		}
	}
	if( FoundID == 2 )
	{
	    print("[Error:] Pickup limit reached. Pickup not created");
	    return -1;
	}
	Pickup[ID][pickupCreated] = 1;
	Pickup[ID][pickupVisible] = 0;
	Pickup[ID][pickupModel] = model;
	Pickup[ID][pickupType] = type;
	Pickup[ID][pickupX] = x;
	Pickup[ID][pickupY] = y;
	Pickup[ID][pickupZ] = z;
	Pickup[ID][pickupRange] = range;
	return ID;

}
Defines
Код:
enum pickupINFO
{
	pickupCreated,
	pickupVisible,
	pickupID,
	pickupRange,
	Float:pickupX,
	Float:pickupY,
	Float:pickupZ,
 	pickupType,
	pickupModel
}
new Pickup[MAX_S_PICKUPS+1][pickupINFO];
Please help thnx
Reply
#2

Specific line with error...
Reply
#3

many
Reply
#4

He meant to post the errors that you're getting, along with their lines.
Reply
#5

It has many error lines i extracted it from my gm

F:\Copy of Pawnofinal\gamemodes\mrp.pwn(4857 : warning 213: tag mismatch
F:\Copy of Pawnofinal\gamemodes\mrp.pwn(48579) : warning 213: tag mismatch
F:\Copy of Pawnofinal\gamemodes\mrp.pwn(48580) : warning 213: tag mismatch
F:\Copy of Pawnofinal\gamemodes\mrp.pwn(48581) : warning 213: tag mismatch
F:\Copy of Pawnofinal\gamemodes\mrp.pwn(48582) : warning 213: tag mismatch
F:\Copy of Pawnofinal\gamemodes\mrp.pwn(48583) : warning 213: tag mismatch
F:\Copy of Pawnofinal\gamemodes\mrp.pwn(48584) : warning 213: tag mismatch
F:\Copy of Pawnofinal\gamemodes\mrp.pwn(48585) : warning 213: tag mismatch
F:\Copy of Pawnofinal\gamemodes\mrp.pwn(48586) : warning 213: tag mismatch
Reply
#6

Please tell me where is the error
P.S first error is in the 2nd line of the code i posted
Reply
#7

Help please!
Reply
#8

what are the lines that are giving off these errors though, enlighten me with the lines please. Post the code of the lines here.
Reply
#9

These lines
Код:
	Pickup[ID][pickupCreated] = 1;
	Pickup[ID][pickupVisible] = 0;
	Pickup[ID][pickupModel] = model;
	Pickup[ID][pickupType] = type;
	Pickup[ID][pickupX] = x;
	Pickup[ID][pickupY] = y;
	Pickup[ID][pickupZ] = z;
	Pickup[ID][pickupRange] = range;
	return ID;
Код:
public ChangeStreamPickupModel(ID,newmodel)
{
    if(Pickup[ID][pickupCreated])
	{
	    DestroyPickup(Pickup[ID][pickupID]);
	    Pickup[ID][pickupVisible] = 0;
		Pickup[ID][pickupModel] = newmodel;
		return 1;
	}
	return 0;
}
public MoveStreamPickup(ID,Float:x,Float:y,Float:z)
{
	if(Pickup[ID][pickupCreated])
	{
	    DestroyPickup(Pickup[ID][pickupID]);
	    Pickup[ID][pickupVisible] = 0;
		Pickup[ID][pickupX] = x;
		Pickup[ID][pickupY] = y;
		Pickup[ID][pickupZ] = z;
And the following lines cause the error local variable "ID" shadows a variable at a preceding level
Код:
public MoveStreamPickup(ID,Float:x,Float:y,Float:z)
public CreateStreamPickup(model,type,Float:x,Float:y,Float:z,range)
{
	new FoundID = 0;
	new ID;//This line cause the error

	for ( new i = 0; FoundID <= 0 ; i++)
	{
	    if( Pickup[i][pickupCreated] == 0 )
	    {
	        if( FoundID == 0 )
	        {
	     	   ID = i;
	     	   FoundID = 1;
	        }
	    }
	    if( i > MAX_S_PICKUPS )
	    {
		    FoundID = 2;
		}
	}
	if( FoundID == 2 )
	{
	    print("[Error:] Pickup limit reached. Pickup not created");
	    return -1;
	}
	Pickup[ID][pickupCreated] = 1;
	Pickup[ID][pickupVisible] = 0;
	Pickup[ID][pickupModel] = model;
	Pickup[ID][pickupType] = type;
	Pickup[ID][pickupX] = x;
	Pickup[ID][pickupY] = y;
	Pickup[ID][pickupZ] = z;
	Pickup[ID][pickupRange] = range;
	return ID;

}
Reply
#10

Quote:
Originally Posted by Swiftz
Посмотреть сообщение
These lines
Код:
	Pickup[ID][pickupCreated] = 1;
	Pickup[ID][pickupVisible] = 0;
	Pickup[ID][pickupModel] = model;
	Pickup[ID][pickupType] = type;
	Pickup[ID][pickupX] = x;
	Pickup[ID][pickupY] = y;
	Pickup[ID][pickupZ] = z;
	Pickup[ID][pickupRange] = range;
	return ID;
Код:
public ChangeStreamPickupModel(ID,newmodel)
{
    if(Pickup[ID][pickupCreated])
	{
	    DestroyPickup(Pickup[ID][pickupID]);
	    Pickup[ID][pickupVisible] = 0;
		Pickup[ID][pickupModel] = newmodel;
		return 1;
	}
	return 0;
}
public MoveStreamPickup(ID,Float:x,Float:y,Float:z)
{
	if(Pickup[ID][pickupCreated])
	{
	    DestroyPickup(Pickup[ID][pickupID]);
	    Pickup[ID][pickupVisible] = 0;
		Pickup[ID][pickupX] = x;
		Pickup[ID][pickupY] = y;
		Pickup[ID][pickupZ] = z;
And the following lines cause the error local variable "ID" shadows a variable at a preceding level
Код:
public MoveStreamPickup(ID,Float:x,Float:y,Float:z)
public CreateStreamPickup(model,type,Float:x,Float:y,Float:z,range)
{
	new FoundID = 0;
	new ID;//This line cause the error

	for ( new i = 0; FoundID <= 0 ; i++)
	{
	    if( Pickup[i][pickupCreated] == 0 )
	    {
	        if( FoundID == 0 )
	        {
	     	   ID = i;
	     	   FoundID = 1;
	        }
	    }
	    if( i > MAX_S_PICKUPS )
	    {
		    FoundID = 2;
		}
	}
	if( FoundID == 2 )
	{
	    print("[Error:] Pickup limit reached. Pickup not created");
	    return -1;
	}
	Pickup[ID][pickupCreated] = 1;
	Pickup[ID][pickupVisible] = 0;
	Pickup[ID][pickupModel] = model;
	Pickup[ID][pickupType] = type;
	Pickup[ID][pickupX] = x;
	Pickup[ID][pickupY] = y;
	Pickup[ID][pickupZ] = z;
	Pickup[ID][pickupRange] = range;
	return ID;

}
tag mismatch mean that you have two things that maybe can have conflict...
Try searching maybe you have TWO stock/non-stock callbacks or maybe some definitons are already used/defined.

the "Shadows a variable at a preceding level" warning means you have defined the variable "ID" as a global variable at the top of your script. Meaning you can either delete the global variable at the top or delete the one you are using at the bottom, or even better just rename "ID" to something else. for example "ID1" etc...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)