Why this error?
#1

My code:
pawn Код:
// Top
new something[MAX_PLAYERS][2]

// in a callback
new variable[128];
variable = something[playerid][1];
Error:
Код:
error 033: array must be indexed (variable "variable")
How to fix?
Reply
#2

Код:
// Top
new something[MAX_PLAYERS][2]

// in a callback
new variable[128];
variable[1] = something[playerid][1];
try this?

or

Код:
// Top
new something[MAX_PLAYERS][2][128]

// in a callback
new variable[128];
variable = something[playerid][1];
Reply
#3


Don't work
Reply
#4

its better if you explain what you want to do
Reply
#5

If its a string, use format.

What are you using the variable for?
Reply
#6

Quote:
Originally Posted by Mikeshake
If its a string, use format.

What are you using the variable for?
For a dissconnect reason
if anybody ban a player then the reason will be changed in something
Reply
#7

But something strange:

if i do:

pawn Код:
something[playerid][1] = "Some Reason here";
Then it give this error:

Код:
error 006: must be assigned to an array
Reply
#8

Variable = "String";
Reply
#9

Quote:
Originally Posted by harrold
But something strange:

if i do:

pawn Код:
something[playerid][1] = "Some Reason here";
Then it give this error:

Код:
error 006: must be assigned to an array
try
pawn Код:
something[playerid][1][128] = "Some Reason here";
Reply
#10

if i go use strings then it won't work

pawn Код:
something[playerid][strlen(string)]=string;
Код:
error 006: must be assigned to an array
Reply
#11

Quote:
Originally Posted by harrold
if i go use strings then it won't work

pawn Код:
something[playerid][strlen(string)]=string;
Код:
error 006: must be assigned to an array
You just should to define string as
Код:
new something[MAX_PLAYERS][2][128];
assign it like
Код:
something[playerid][1] = "BUhahaha lol imao";
and use like
Код:
print(something[playerid][1]);
Reply
#12

Thanks man that works
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)