error 006: must be assigned to an array
#1

pawn Код:
new Origin[MAX_PLAYER_NAME];
    format(Origin, sizeof(Origin), "Nowhere");
    PlayerInfo[playerid][pOrigin] = Origin; // error 006 here
What's wrong please?
Reply
#2

pawn Код:
new Origin[MAX_PLAYER_NAME];
format(Origin, sizeof(Origin), "Nowhere");
strmid(PlayerInfo[playerid][pOrigin], string, 0, strlen(string), 128);
Reply
#3

Quote:
Originally Posted by Dujma
pawn Код:
new Origin[MAX_PLAYER_NAME];
format(Origin, sizeof(Origin), "Nowhere");
strmid(PlayerInfo[playerid][pOrigin], string, 0, strlen(string), 128);
Thanks a lot, but where's strmid function from? Which include? And could you please explain me how it works?
Reply
#4

https://sampwiki.blast.hk/wiki/Scripting...ons_Old#strmid
Reply
#5

You can change the string size to this
pawn Код:
strmid(PlayerInfo[playerid][pOrigin], string, 0, strlen(string), MAX_PLAYER_NAME);
Reply
#6

Quote:
Originally Posted by [K4L
Thanks a lot dude.
Quote:
Originally Posted by Dujma
You can change the string size to this

pawn Код:
strmid(PlayerInfo[playerid][pOrigin], string, 0, strlen(string), MAX_PLAYER_NAME);
I'll actually change it to 64 because I don't want it to have more the 64 characters
Thanks anyway
Reply
#7

Quote:
Originally Posted by Coicatak
dude.
I'll actually change it to 64 because I don't want it to have more the 64 characters
Thanks anyway
It won't have more than (the amount of MAX_PLAYER_NAME) characters, because that's the size of the strings you're using.

pawn Код:
new Origin[MAX_PLAYER_NAME];
Just keep it empty, it should work.
Reply
#8

Quote:
Originally Posted by Coicatak
Quote:
Originally Posted by [K4L
Thanks a lot
Quote:
Originally Posted by Dujma
You can change the string size to this

pawn Код:
strmid(PlayerInfo[playerid][pOrigin], string, 0, strlen(string), MAX_PLAYER_NAME);
dude.
I'll actually change it to 64 because I don't want it to have more the 64 characters
Thanks anyway
hehe you already define that the max lenght of string is 16 so there is no point of using 128 or 64 for input.
Reply
#9

What about
pawn Код:
#define MAX_ORIGIN_SIZE 64
//...
format(PlayerInfo[playerid][pOrigin], MAX_ORIGIN_SIZE, "Nowhere");

Reply
#10

Quote:
Originally Posted by Dujma
hehe you already define that the max lenght of string is 16 so there is no point of using 128 or 64 for input.
Oh really? Where?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)