SA-MP Forums Archive
tag mismatch at WHAT?! - 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: tag mismatch at WHAT?! (/showthread.php?tid=588110)



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
View Post
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
View Post
replace
pawn Code:
new buds = random(6); (max-1)
with
pawn Code:
new buds = 1 + random(4);
Quote:
Originally Posted by IceBilizard
View Post
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
View Post
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
View Post
replace
pawn Code:
new buds = random(6); (max-1)
with
pawn Code:
new buds = 1 + random(4);
Quote:
Originally Posted by ._Xavier$$
View Post
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
View Post
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!