Problem with textdraw script
#1

Hi all
i have scripted an long time on my gamemode but now i want to create a textdraw -Code Below-
Код:
{
	Help-titel = TextDrawCreate(500, 130, "Help"); // line 3465
	TextDrawLetterSize(Text:Help-titel, 0, 0);
	TextDrawTextSize(Text:Help-titel, 0, 0);
	TextDrawAlignment(Text:Help-titel, 0);
	TextDrawColor(Text:Help-titel, 48042);
	TextDrawUseBox(Text:Help-titel, 1);
	TextDrawSetShadow(Text:Help-titel, 0);
	TextDrawBoxColor(Text:Help-titel, -1347440726);
	TextDrawSetOutline(Text:Help-titel, 0);
	TextDrawBackgroundColor(Text:Help-titel, 170);
	TextDrawFont(Text:Help-titel, 1);
	TextDrawSetProportional(Text:Help-titel, 1);
	return 1;
}
But it has an error i can't fix -error below-
Код:
C:\server(3465) : error 022: must be lvalue (non-constant)
Does anybody know what i did wrong ?
Reply
#2

at the top of you script.. did you do
pawn Код:
new:Text:Help-titel;
Reply
#3

now i did but i receive two error's now wich is almost the same problem
Код:
C:\Users\RP.pwn(3465) : error 001: expected token: "-identifier-", but found ":"
C:\Users\RP.pwn(3466) : error 022: must be lvalue (non-constant)
current code :
Код:
{
        new:Text:Help-titel; // 3465
	Help-titel = TextDrawCreate(500, 130, "Help"); // line 3466
	TextDrawLetterSize(Text:Help-titel, 0, 0); // line 3467
	TextDrawTextSize(Text:Help-titel, 0, 0); // line 3468
	TextDrawAlignment(Text:Help-titel, 0);
	TextDrawColor(Text:Help-titel, 48042);
	TextDrawUseBox(Text:Help-titel, 1);
	TextDrawSetShadow(Text:Help-titel, 0);
	TextDrawBoxColor(Text:Help-titel, -1347440726);
	TextDrawSetOutline(Text:Help-titel, 0);
	TextDrawBackgroundColor(Text:Help-titel, 170);
	TextDrawFont(Text:Help-titel, 1);
	TextDrawSetProportional(Text:Help-titel, 1);
	return 1;
}
Reply
#4

dude at the top of the script not ongamemode init:
oh my bad, delete the : after new so it will be :
pawn Код:
new Text:Help-titel;
instead of :
pawn Код:
new:Text:Help-titel;
now ongamemodeinit:
pawn Код:
Help-titel = TextDrawCreate(500, 130, "Help"); // line 3466
    TextDrawLetterSize(Text:Help-titel, 0, 0); // line 3467
    TextDrawTextSize(Text:Help-titel, 0, 0); // line 3468
    TextDrawAlignment(Text:Help-titel, 0);
    TextDrawColor(Text:Help-titel, 48042);
    TextDrawUseBox(Text:Help-titel, 1);
    TextDrawSetShadow(Text:Help-titel, 0);
    TextDrawBoxColor(Text:Help-titel, -1347440726);
    TextDrawSetOutline(Text:Help-titel, 0);
    TextDrawBackgroundColor(Text:Help-titel, 170);
    TextDrawFont(Text:Help-titel, 1);
    TextDrawSetProportional(Text:Help-titel, 1);
Reply
#5

And change "Help-titel" with "Help_titel". You can't create variables with that character.
Reply
#6

wow thanks that helped a lot Eth
Quote:

dude at the top of the script not ongamemode init:
oh my bad, delete the : after new so it will be :
pawn Code:

new Text:Help-titel;

instead of :
pawn Code:

new:Text:Help-titel;

now ongamemodeinit:
pawn Code:

Help-titel = TextDrawCreate(500, 130, "Help"); // line 3466
TextDrawLetterSize(Text:Help-titel, 0, 0); // line 3467
TextDrawTextSize(Text:Help-titel, 0, 0); // line 3468
TextDrawAlignment(Text:Help-titel, 0);
TextDrawColor(Text:Help-titel, 48042);
TextDrawUseBox(Text:Help-titel, 1);
TextDrawSetShadow(Text:Help-titel, 0);
TextDrawBoxColor(Text:Help-titel, -1347440726);
TextDrawSetOutline(Text:Help-titel, 0);
TextDrawBackgroundColor(Text:Help-titel, 170);
TextDrawFont(Text:Help-titel, 1);
TextDrawSetProportional(Text:Help-titel, 1);
but then i got an other error i don't know what it was but anyway it had something with what IstuntmanI said
Quote:

And change "Help-titel" with "Help_titel". You can't create variables with that character.

Thanks IstuntmanI For that fix !
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)