tag mismatch at WHAT?! -
KrazyKidd - 05.09.2015
So my weed system - you can get between 1 - 5 buds from one plant.
new buds = random(6); (max-1)
PlayerInfo[playerid][Weed] += buds;
However, on "PlayerInfo[playerid][Weed] += buds;" I get these errors:
warning 213: tag mismatch
error 032: array index out of bounds (variable "PlayerInfo")
Re: tag mismatch at WHAT?! -
IceBilizard - 05.09.2015
replace
pawn Code:
new buds = random(6); (max-1)
with
pawn Code:
new buds = 1 + random(4);
Re: tag mismatch at WHAT?! -
KrazyKidd - 05.09.2015
Quote:
Originally Posted by IceBilizard
replace
pawn Code:
new buds = random(6); (max-1)
with
pawn Code:
new buds = 1 + random(4);
|
Nope, I still get those errors.
Re: tag mismatch at WHAT?! -
IceBilizard - 05.09.2015
then change
PlayerInfo[playerid][Weed] += buds;
to PlayerInfo[playerid][Weed] = buds;
and try
Re: tag mismatch at WHAT?! -
khRamin78 - 05.09.2015
show us your enum varb for pinfo also use an varb too save your last data first
Re: tag mismatch at WHAT?! -
KrazyKidd - 05.09.2015
Quote:
Originally Posted by IceBilizard
replace
pawn Code:
new buds = random(6); (max-1)
with
pawn Code:
new buds = 1 + random(4);
|
Quote:
Originally Posted by IceBilizard
then change
PlayerInfo[playerid][Weed] += buds;
to PlayerInfo[playerid][Weed] = buds;
and try
|
The += adds to the current value, I dont' want them to have 20 weed and then it be set to 3.
Quote:
Originally Posted by khRamin78
show us your enum varb for pinfo also use an varb too save your last data first
|
There's nothing wrong with the PlayerInfo vars, they're fine. Everything else is working except for those two lines.
Re: tag mismatch at WHAT?! -
Variable⢠- 05.09.2015
Code:
PlayerInfo[playerid][Weed] += buds;
to
Code:
PlayerInfo[playerid][Weed] + buds;
Re: tag mismatch at WHAT?! -
Mauzen - 05.09.2015
Quote:
Originally Posted by IceBilizard
replace
pawn Code:
new buds = random(6); (max-1)
with
pawn Code:
new buds = 1 + random(4);
|
Quote:
Originally Posted by ._Xavier$$
Code:
PlayerInfo[playerid][Weed] += buds;
to
Code:
PlayerInfo[playerid][Weed] + buds;
|
Do you guys even have the slightest idea of what youre writing here, or are you just randomly adding/removing caharacters from the code?
Probably "Weed" is not part of PlayerInfo's enum. You cant mix up two enums in the same array, you probably added Weed to an enum definition that isnt used by PlayerInfo.
Re: tag mismatch at WHAT?! -
Variable⢠- 05.09.2015
Code:
enum WeedI
{
Weed
};
new WeedInfo[MAX_PLAYERS][WeedI];
Code:
WeedInfo[playerid][Weed] += buds;
Re: tag mismatch at WHAT?! -
KrazyKidd - 05.09.2015
Quote:
Originally Posted by Mauzen
Do you guys even have the slightest idea of what youre writing here, or are you just randomly adding/removing caharacters from the code?
Probably "Weed" is not part of PlayerInfo's enum. You cant mix up two enums in the same array, you probably added Weed to an enum definition that isnt used by PlayerInfo.
|
Correct. I thought I added it, I guess not. Thanks dude!