Text for player
#1

Hello!

i want to save a text into an Variable but only for 1 Player

Код:
new uebergabe[MAX_PLAYERS][128];
below (Line 30791 and 30792)

Код:
uebergabe[playerid] = textdesspielers
Funktion(playerid, uebergabe[playerid]);
But i get an error code

Код:
(30791 -- 30792) : error 047: array sizes do not match, or destination array is too small
I hope someone can help me.

Best regards
Reply
#2

You forgot a semicolon ";", take this:



uebergabe[playerid] = textdesspielers;
Funktion(playerid, uebergabe[playerid]);
Reply
#3

Change
pawn Код:
uebergabe[playerid] = textdesspielers;
Funktion(playerid, uebergabe[playerid]);
to:
pawn Код:
new uebergabe[playerid] = textdesspielers;
new Funktion(playerid, uebergabe[playerid]);
Reply
#4

thanks for your answers.

Bug it don't work. I tried both..

@Twisted_Insane: same error again
@Quinlynn: More errors
Reply
#5

Try this:



pawn Код:
uebergabe[playerid] = textdesspielers;
Funktion(playerid, [uebergabe(playerid)];
Also, why you got "playerid" twice?
Reply
#6

Can't assign a literal string to a two-dimensional array. Use strcpy/strcat/strmid to copy strings.
Reply
#7

Quote:
Originally Posted by Vince
Посмотреть сообщение
Can't assign a literal string to a two-dimensional array. Use strcpy/strcat/strmid to copy strings.
Yes you can, but only if the string sizes match.
pawn Код:
enum heyyyy {
    largestring[128],
    smallstring[128],
}
new PlayerInfo[MAX_PLAYERS][heyyyy];

PlayerInfo[playerid][smallstring] = PlayerInfo[playerid][largestring]; // error
PlayerInfo[playerid][largestring] = PlayerInfo[playerid][smallstring]; // no error
@thread author
use stract...

Quote:
Originally Posted by Quinlynn
Посмотреть сообщение
pawn Код:
new uebergabe[playerid] = textdesspielers;
new Funktion(playerid, uebergabe[playerid]);
Stop posting if you're not familiar with any part of coding.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)