tag mismatch at WHAT?!
#1

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")
Reply
#2

replace
pawn Code:
new buds = random(6); (max-1)
with
pawn Code:
new buds = 1 + random(4);
Reply
#3

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.
Reply
#4

then change

PlayerInfo[playerid][Weed] += buds;

to PlayerInfo[playerid][Weed] = buds;

and try
Reply
#5

show us your enum varb for pinfo also use an varb too save your last data first
Reply
#6

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.
Reply
#7

Code:
PlayerInfo[playerid][Weed] += buds;
to
Code:
PlayerInfo[playerid][Weed] + buds;
Reply
#8

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.
Reply
#9

Code:
enum WeedI
{
    Weed
};
new WeedInfo[MAX_PLAYERS][WeedI];
Code:
    WeedInfo[playerid][Weed] += buds;
Reply
#10

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)