SA-MP Forums Archive
Textdraw errors - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Textdraw errors (/showthread.php?tid=655535)



Textdraw errors - mmostafa - 23.06.2018

Hello guys,
i have this errors in the textdraws i made
PHP код:
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(984) : error 033: array must be indexed (variable "Hetalth")
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(985) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(986) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(987) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(988) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(989) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(990) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(991) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(993) : error 033: array must be indexed (variable "Armour")
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(994) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(995) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(996) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(997) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(998) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(999) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1000) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1002) : error 033: array must be indexed (variable "pitng")
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1003) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1004) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1005) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1006) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1007) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1008) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1009) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1011) : error 033: array must be indexed (variable "xp")
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1012) : error 035argument type mismatch (argument 2)
Compilation aborted.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
26 Errors

PHP код:
    [COLOR="Red"]Hetalth CreatePlayerTextDraw(playerid,552.00000066.000000"");
    
PlayerTextDrawBackgroundColor(playerid,Hetalth255);
    
PlayerTextDrawFont(playerid,Hetalth1);
    
PlayerTextDrawLetterSize(playerid,Hetalth0.2200000.899999);
    
PlayerTextDrawColor(playerid,Hetalth, -1);
    
PlayerTextDrawSetOutline(playerid,Hetalth1);
    
PlayerTextDrawSetProportional(playerid,Hetalth1);
    
PlayerTextDrawSetSelectable(playerid,Hetalth0);
    
Armour CreatePlayerTextDraw(playerid,553.00000044.000000"");
    
PlayerTextDrawBackgroundColor(playerid,Armour255);
    
PlayerTextDrawFont(playerid,Armour1);
    
PlayerTextDrawLetterSize(playerid,Armour0.1900000.899999);
    
PlayerTextDrawColor(playerid,Armour, -65281);
    
PlayerTextDrawSetOutline(playerid,Armour1);
    
PlayerTextDrawSetProportional(playerid,Armour1);
    
PlayerTextDrawSetSelectable(playerid,Armour0);
    
pitng CreatePlayerTextDraw(playerid,609.0000000.000000"");
    
PlayerTextDrawBackgroundColor(playerid,pitng255);
    
PlayerTextDrawFont(playerid,pitng1);
    
PlayerTextDrawLetterSize(playerid,pitng0.5000001.000000);
    
PlayerTextDrawColor(playerid,pitng16711935);
    
PlayerTextDrawSetOutline(playerid,pitng1);
    
PlayerTextDrawSetProportional(playerid,pitng1);
    
PlayerTextDrawSetSelectable(playerid,pitng0);
    
xp CreatePlayerTextDraw(playerid,538.000000410.000000"");
    
PlayerTextDrawBackgroundColor(playerid,xp4607);[/COLOR]//till here the errors
    
PlayerTextDrawFont(playerid,xp1);
    
PlayerTextDrawLetterSize(playerid,xp0.5000001.000000);
    
PlayerTextDrawColor(playerid,xp, -1);
    
PlayerTextDrawSetOutline(playerid,xp1);
    
PlayerTextDrawSetProportional(playerid,xp1);
    
PlayerTextDrawSetSelectable(playerid,xp0); 
Please Help me


Re: Textdraw errors - mmostafa - 23.06.2018

PHP код:
new    PlayerText:xp[MAX_PLAYERS];
new    
PlayerText:Scoretd[MAX_PLAYERS];
new    
PlayerText:pitng[MAX_PLAYERS];
new    
PlayerText:Hetalth[MAX_PLAYERS];
new    
PlayerText:Armour[MAX_PLAYERS]; 
I forgot to add the defines, please help me


Re: Textdraw errors - JasonRiggs - 23.06.2018

You should use it like that..

PHP код:
xp[playerid] = CreatePlayerTextDraw(playerid,552.00000066.000000""); 
etc..

So the whole code should be like that..

PHP код:
   [COLOR="Red"]Hetalth[playerid] = CreatePlayerTextDraw(playerid,552.00000066.000000"");
    
PlayerTextDrawBackgroundColor(playerid,Hetalth255);
    
PlayerTextDrawFont(playerid,Hetalth1);
    
PlayerTextDrawLetterSize(playerid,Hetalth0.2200000.899999);
    
PlayerTextDrawColor(playerid,Hetalth, -1);
    
PlayerTextDrawSetOutline(playerid,Hetalth1);
    
PlayerTextDrawSetProportional(playerid,Hetalth1);
    
PlayerTextDrawSetSelectable(playerid,Hetalth0);

    
Armour[playerid] = CreatePlayerTextDraw(playerid,553.00000044.000000"");
    
PlayerTextDrawBackgroundColor(playerid,Armour255);
    
PlayerTextDrawFont(playerid,Armour1);
    
PlayerTextDrawLetterSize(playerid,Armour0.1900000.899999);
    
PlayerTextDrawColor(playerid,Armour, -65281);
    
PlayerTextDrawSetOutline(playerid,Armour1);
    
PlayerTextDrawSetProportional(playerid,Armour1);
    
PlayerTextDrawSetSelectable(playerid,Armour0);

    
pitng[playerid] = CreatePlayerTextDraw(playerid,609.0000000.000000"");
    
PlayerTextDrawBackgroundColor(playerid,pitng255);
    
PlayerTextDrawFont(playerid,pitng1);
    
PlayerTextDrawLetterSize(playerid,pitng0.5000001.000000);
    
PlayerTextDrawColor(playerid,pitng16711935);
    
PlayerTextDrawSetOutline(playerid,pitng1);
    
PlayerTextDrawSetProportional(playerid,pitng1);
    
PlayerTextDrawSetSelectable(playerid,pitng0);

    
xp[playerid] = CreatePlayerTextDraw(playerid,538.000000410.000000"");
    
PlayerTextDrawBackgroundColor(playerid,xp4607);[/COLOR]//till here the errors
    
PlayerTextDrawFont(playerid,xp1);
    
PlayerTextDrawLetterSize(playerid,xp0.5000001.000000);
    
PlayerTextDrawColor(playerid,xp, -1);
    
PlayerTextDrawSetOutline(playerid,xp1);
    
PlayerTextDrawSetProportional(playerid,xp1);
    
PlayerTextDrawSetSelectable(playerid,xp0); 



Re: Textdraw errors - Sew_Sumi - 23.06.2018

Код:
Hetalth = CreatePlayerTextDraw(playerid,552.000000, 66.000000, "");
Your error starts there...

Код:
array must be indexed (variable "Hetalth"
And how do you reference an array? Because this isn't how to do it.


The first error in the output, is the first to remedy as it goes top to bottom, and others under it will be from the first.

However, with this, each textdraw you are creating has a problem, and it's all the same problem.


Re: Textdraw errors - mmostafa - 23.06.2018

Quote:
Originally Posted by JasonRiggs
Посмотреть сообщение
You should use it like that..

PHP код:
xp[playerid] = CreatePlayerTextDraw(playerid,552.00000066.000000""); 
etc..

So the whole code should be like that..

PHP код:
   [COLOR="Red"]Hetalth[playerid] = CreatePlayerTextDraw(playerid,552.00000066.000000"");
    
PlayerTextDrawBackgroundColor(playerid,Hetalth255);
    
PlayerTextDrawFont(playerid,Hetalth1);
    
PlayerTextDrawLetterSize(playerid,Hetalth0.2200000.899999);
    
PlayerTextDrawColor(playerid,Hetalth, -1);
    
PlayerTextDrawSetOutline(playerid,Hetalth1);
    
PlayerTextDrawSetProportional(playerid,Hetalth1);
    
PlayerTextDrawSetSelectable(playerid,Hetalth0);
    
Armour[playerid] = CreatePlayerTextDraw(playerid,553.00000044.000000"");
    
PlayerTextDrawBackgroundColor(playerid,Armour255);
    
PlayerTextDrawFont(playerid,Armour1);
    
PlayerTextDrawLetterSize(playerid,Armour0.1900000.899999);
    
PlayerTextDrawColor(playerid,Armour, -65281);
    
PlayerTextDrawSetOutline(playerid,Armour1);
    
PlayerTextDrawSetProportional(playerid,Armour1);
    
PlayerTextDrawSetSelectable(playerid,Armour0);
    
pitng[playerid] = CreatePlayerTextDraw(playerid,609.0000000.000000"");
    
PlayerTextDrawBackgroundColor(playerid,pitng255);
    
PlayerTextDrawFont(playerid,pitng1);
    
PlayerTextDrawLetterSize(playerid,pitng0.5000001.000000);
    
PlayerTextDrawColor(playerid,pitng16711935);
    
PlayerTextDrawSetOutline(playerid,pitng1);
    
PlayerTextDrawSetProportional(playerid,pitng1);
    
PlayerTextDrawSetSelectable(playerid,pitng0);
    
xp[playerid] = CreatePlayerTextDraw(playerid,538.000000410.000000"");
    
PlayerTextDrawBackgroundColor(playerid,xp4607);[/COLOR]//till here the errors
    
PlayerTextDrawFont(playerid,xp1);
    
PlayerTextDrawLetterSize(playerid,xp0.5000001.000000);
    
PlayerTextDrawColor(playerid,xp, -1);
    
PlayerTextDrawSetOutline(playerid,xp1);
    
PlayerTextDrawSetProportional(playerid,xp1);
    
PlayerTextDrawSetSelectable(playerid,xp0); 
PHP код:
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(985) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(986) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(987) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(988) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(989) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(990) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(991) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(994) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(995) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(996) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(997) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(998) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(999) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1000) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1003) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1004) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1005) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1006) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1007) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1008) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1009) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1012) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1013) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1014) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1015) : error 035argument type mismatch (argument 2)
C:\Users\Mohamed\Desktop\BGCNR By Jikesh\pawno\include\cnr/cnr_textdraws.inc(1016) : error 035argument type mismatch (argument 2)
Compilation aborted.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
26 Errors




Re: Textdraw errors - Sew_Sumi - 23.06.2018

It's because you have arrays, and variables that have the same name... Don't do this.

You have xp[playerid] in the array, and yet you still use xp as a variable. These will conflict.


Re: Textdraw errors - UFF - 24.06.2018

Код:
    Hetalth[playerid] = CreatePlayerTextDraw(playerid,552.000000, 66.000000, "");
    PlayerTextDrawBackgroundColor(playerid,Hetalth[playerid], 255);
    PlayerTextDrawFont(playerid,Hetalth[playerid], 1);
    PlayerTextDrawLetterSize(playerid,Hetalth[playerid], 0.220000, 0.899999);
    PlayerTextDrawColor(playerid,Hetalth[playerid], -1);
    PlayerTextDrawSetOutline(playerid,Hetalth[playerid]h, 1);
    PlayerTextDrawSetProportional(playerid,Hetalth[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,Hetalth[playerid], 0);

    Armour[playerid] = CreatePlayerTextDraw(playerid,553.000000, 44.000000, "");
    PlayerTextDrawBackgroundColor(playerid,Armour[playerid], 255);
    PlayerTextDrawFont(playerid,Armour[playerid], 1);
    PlayerTextDrawLetterSize(playerid,Armour[playerid], 0.190000, 0.899999);
    PlayerTextDrawColor(playerid,Armour[playerid], -65281);
    PlayerTextDrawSetOutline(playerid,Armour[playerid], 1);
    PlayerTextDrawSetProportional(playerid,Armour[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,Armour[playerid], 0);

    pitng[playerid] = CreatePlayerTextDraw(playerid,609.000000, 0.000000, "");
    PlayerTextDrawBackgroundColor(playerid,pitng[playerid], 255);
    PlayerTextDrawFont(playerid,pitng[playerid], 1);
    PlayerTextDrawLetterSize(playerid,pitng[playerid], 0.500000, 1.000000);
    PlayerTextDrawColor(playerid,pitng[playerid], 16711935);
    PlayerTextDrawSetOutline(playerid,pitng[playerid], 1);
    PlayerTextDrawSetProportional(playerid,pitng[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,pitng[playerid], 0);

    xp[playerid] = CreatePlayerTextDraw(playerid,538.000000, 410.000000, "");
    PlayerTextDrawBackgroundColor(playerid,xp[playerid], 4607);
    PlayerTextDrawFont(playerid,xp[playerid], 1);
    PlayerTextDrawLetterSize(playerid,xp[playerid], 0.500000, 1.000000);
    PlayerTextDrawColor(playerid,xp[playerid], -1);
    PlayerTextDrawSetOutline(playerid,xp[playerid], 1);
    PlayerTextDrawSetProportional(playerid,xp[playerid], 1);
    PlayerTextDrawSetSelectable(playerid,xp[playerid], 0);
Use this.


Re: Textdraw errors - Logic_ - 24.06.2018

Sew Sumi is right.

You can follow https://en.wikipedia.org/wiki/Hungarian_notation and name your variables as following:

pXPTD[playerid],
pHealthTD[playerid],
pArmourTD[playerid]

'p' as the prefix standing for 'player' and the 'TD' in the suffix meaning textdraw.

gPing

'g' as the prefix standing for 'global'.