HELP textdraw problem
#1

C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2000) : error 028: invalid subscript (not an array or too many subscripts): "Pinigai0"
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2000) : warning 215: expression has no effect
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2000) : error 001: expected token: ";", but found "]"
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2000) : error 029: invalid expression, assumed zero
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2000) : fatal error 107: too many error messages on one line



LINE

for ( new i = 0; i < MAX_PLAYERS; i++)
{
//Hide all the text draws for the players
TextDrawHideForPlayer(i, Pinigai0[i]);
TextDrawHideForPlayer(i, Pinigai1[i]);
TextDrawHideForPlayer(i, Pinigai2[i]);
TextDrawHideForPlayer(i, Pinigai3[i]);
TextDrawHideForPlayer(i, Pinigai4[i]);
}
Reply
#2

for ( new i = 0; i < MAX_PLAYERS; i++)
{
//Hide all the text draws for the players
TextDrawHideForPlayer(i, Pinigai0(i));
TextDrawHideForPlayer(i, Pinigai1(i));
TextDrawHideForPlayer(i, Pinigai2(i));
TextDrawHideForPlayer(i, Pinigai3(i));
TextDrawHideForPlayer(i, Pinigai4(i));
}
Reply
#3

Still the same
Reply
#4

Quote:

C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2000) : error 028: invalid subscript (not an array or too many subscripts): "Pinigai0"

Try;
for ( new i = 0; i < MAX_PLAYERS; i++)
{
//Hide all the text draws for the players
TextDrawHideForPlayer(i, Pinigai0);
TextDrawHideForPlayer(i, Pinigai1);
TextDrawHideForPlayer(i, Pinigai2);
TextDrawHideForPlayer(i, Pinigai3);
TextDrawHideForPlayer(i, Pinigai4);
}
Reply
#5

C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2000) : warning 213: tag mismatch
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2001) : warning 213: tag mismatch
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2002) : warning 213: tag mismatch
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2003) : warning 213: tag mismatch
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2004) : warning 213: tag mismatch
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2092) : error 017: undefined symbol "TexDrawShowForPlayer"
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2092) : warning 215: expression has no effect
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2092) : error 001: expected token: ";", but found "]"
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2092) : error 029: invalid expression, assumed zero
C:\Users\Privatus\Desktop\Justo\SA-MP\FC\gamemodes\GLG.pwn(2092) : fatal error 107: too many error messages on one line
NOW
Reply
#6

TexDrawShowForPlayer

[pawnTextDrawShowForPlayer[/pawn]
Reply
#7

Please post all of your textdraw code. It looks like you forgot to tag the variables with Text:.
Reply
#8

public OnPlayerUpdate(playerid)
{
Pinigai0 = CreatePlayerTextDraw(playerid,497.000000, 80.000000, ".");
PlayerTextDrawBackgroundColor(playerid,Pinigai0, 255);
PlayerTextDrawFont(playerid,Pinigai0, 1);
PlayerTextDrawLetterSize(playerid,Pinigai0, 0.500000, 1.700000);
PlayerTextDrawColor(playerid,Pinigai0, 255);
PlayerTextDrawSetOutline(playerid,Pinigai0, 0);
PlayerTextDrawSetProportional(playerid,Pinigai0, 1);
PlayerTextDrawSetShadow(playerid,Pinigai0, 1);
PlayerTextDrawUseBox(playerid,Pinigai0, 1);
PlayerTextDrawBoxColor(playerid,Pinigai0, 255);
PlayerTextDrawTextSize(playerid,Pinigai0, 608.000000, 11.000000);
PlayerTextDrawSetSelectable(playerid,Pinigai0, 0);

Pinigai1 = CreatePlayerTextDraw(playerid,497.000000, 79.000000, "$");
PlayerTextDrawBackgroundColor(playerid,Pinigai1, 255);
PlayerTextDrawFont(playerid,Pinigai1, 3);
PlayerTextDrawLetterSize(playerid,Pinigai1, 0.500000, 1.700000);
PlayerTextDrawColor(playerid,Pinigai1, -1717986817);
PlayerTextDrawSetOutline(playerid,Pinigai1, 0);
PlayerTextDrawSetProportional(playerid,Pinigai1, 1);
PlayerTextDrawSetShadow(playerid,Pinigai1, 1);
PlayerTextDrawSetSelectable(playerid,Pinigai1, 0);

Pinigai2 = CreatePlayerTextDraw(playerid,496.000000, 82.000000, "............................................. ");
PlayerTextDrawBackgroundColor(playerid,Pinigai2, 255);
PlayerTextDrawFont(playerid,Pinigai2, 2);
PlayerTextDrawLetterSize(playerid,Pinigai2, 0.280000, 1.900000);
PlayerTextDrawColor(playerid,Pinigai2, -1);
PlayerTextDrawSetOutline(playerid,Pinigai2, 0);
PlayerTextDrawSetProportional(playerid,Pinigai2, 1);
PlayerTextDrawSetShadow(playerid,Pinigai2, 1);
PlayerTextDrawSetSelectable(playerid,Pinigai2, 0);

Pinigai3 = CreatePlayerTextDraw(playerid,496.000000, 66.000000, "............................................. ");
PlayerTextDrawBackgroundColor(playerid,Pinigai3, 255);
PlayerTextDrawFont(playerid,Pinigai3, 2);
PlayerTextDrawLetterSize(playerid,Pinigai3, 0.280000, 1.900000);
PlayerTextDrawColor(playerid,Pinigai3, -1);
PlayerTextDrawSetOutline(playerid,Pinigai3, 0);
PlayerTextDrawSetProportional(playerid,Pinigai3, 1);
PlayerTextDrawSetShadow(playerid,Pinigai3, 1);
PlayerTextDrawSetSelectable(playerid,Pinigai3, 0);

Pinigai4 = CreatePlayerTextDraw(playerid,508.000000, 79.000000, "0");
PlayerTextDrawBackgroundColor(playerid,Pinigai4, 255);
PlayerTextDrawFont(playerid,Pinigai4, 3);
PlayerTextDrawLetterSize(playerid,Pinigai4, 0.500000, 1.700000);
PlayerTextDrawColor(playerid,Pinigai4, -1);
PlayerTextDrawSetOutline(playerid,Pinigai4, 0);
PlayerTextDrawSetProportional(playerid,Pinigai4, 1);
PlayerTextDrawSetShadow(playerid,Pinigai4, 1);
PlayerTextDrawSetSelectable(playerid,Pinigai4, 0);

}
return 1;
}
forward Pinigas1(playerid);
public Pinigas1(playerid)
{
new string[128];
format(string, sizeof(string), "%dLt", GetPlayerMoney(playerid));
TextDrawSetString(Pinigai4[playerid], string);
return 1;
}


public OnPlayerSpawn(playerid){
TextDrawShowForPlayer(playerid,Pinigai0[playerid]);
TextDrawShowForPlayer(playerid,Pinigai1[playerid]);
TextDrawShowForPlayer(playerid,Pinigai2[playerid]);
TextDrawShowForPlayer(playerid,Pinigai3[playerid]);
TextDrawShowForPlayer(playerid,Pinigai4[playerid]);
Reply
#9

If you are trying to make a separate text draw for each player, you need to:

1) Make each "Pinigai" variable an array

2) Assign a text draw to each element for each array
Reply
#10

Try this
pawn Код:
new PlayerText:gMoneyTextDraw[MAX_PLAYERS][5];

public OnPlayerConnect(playerid)
{
    gMoneyTextDraw[playerid][0] = CreatePlayerTextDraw(playerid,497.000000, 80.000000, ".");
    PlayerTextDrawBackgroundColor(playerid, gMoneyTextDraw[playerid][0], 255);
    PlayerTextDrawFont(playerid, gMoneyTextDraw[playerid][0], 1);
    PlayerTextDrawLetterSize(playerid, gMoneyTextDraw[playerid][0], 0.500000, 1.700000);
    PlayerTextDrawColor(playerid, gMoneyTextDraw[playerid][0], 255);
    PlayerTextDrawSetOutline(playerid, gMoneyTextDraw[playerid][0], 0);
    PlayerTextDrawSetProportional(playerid, gMoneyTextDraw[playerid][0], 1);
    PlayerTextDrawSetShadow(playerid, gMoneyTextDraw[playerid][0], 1);
    PlayerTextDrawUseBox(playerid, gMoneyTextDraw[playerid][0], 1);
    PlayerTextDrawBoxColor(playerid, gMoneyTextDraw[playerid][0], 255);
    PlayerTextDrawTextSize(playerid, gMoneyTextDraw[playerid][0], 608.000000, 11.000000);
    PlayerTextDrawSetSelectable(playerid, gMoneyTextDraw[playerid][0], 0);

    gMoneyTextDraw[playerid][1] = CreatePlayerTextDraw(playerid,497.000000, 79.000000, "$");
    PlayerTextDrawBackgroundColor(playerid, gMoneyTextDraw[playerid][1], 255);
    PlayerTextDrawFont(playerid, gMoneyTextDraw[playerid][1], 3);
    PlayerTextDrawLetterSize(playerid, gMoneyTextDraw[playerid][1], 0.500000, 1.700000);
    PlayerTextDrawColor(playerid, gMoneyTextDraw[playerid][1], -1717986817);
    PlayerTextDrawSetOutline(playerid, gMoneyTextDraw[playerid][1], 0);
    PlayerTextDrawSetProportional(playerid, gMoneyTextDraw[playerid][1], 1);
    PlayerTextDrawSetShadow(playerid, gMoneyTextDraw[playerid][1], 1);
    PlayerTextDrawSetSelectable(playerid, gMoneyTextDraw[playerid][1], 0);

    gMoneyTextDraw[playerid][2] = CreatePlayerTextDraw(playerid,496.000000, 82.000000, "............................................. ");
    PlayerTextDrawBackgroundColor(playerid, gMoneyTextDraw[playerid][2], 255);
    PlayerTextDrawFont(playerid, gMoneyTextDraw[playerid][2], 2);
    PlayerTextDrawLetterSize(playerid, gMoneyTextDraw[playerid][2], 0.280000, 1.900000);
    PlayerTextDrawColor(playerid, gMoneyTextDraw[playerid][2], -1);
    PlayerTextDrawSetOutline(playerid, gMoneyTextDraw[playerid][2], 0);
    PlayerTextDrawSetProportional(playerid, gMoneyTextDraw[playerid][2], 1);
    PlayerTextDrawSetShadow(playerid, gMoneyTextDraw[playerid][2], 1);
    PlayerTextDrawSetSelectable(playerid, gMoneyTextDraw[playerid][2], 0);

    gMoneyTextDraw[playerid][3] = CreatePlayerTextDraw(playerid,496.000000, 66.000000, "............................................. ");
    PlayerTextDrawBackgroundColor(playerid, gMoneyTextDraw[playerid][3], 255);
    PlayerTextDrawFont(playerid, gMoneyTextDraw[playerid][3], 2);
    PlayerTextDrawLetterSize(playerid, gMoneyTextDraw[playerid][3], 0.280000, 1.900000);
    PlayerTextDrawColor(playerid, gMoneyTextDraw[playerid][3], -1);
    PlayerTextDrawSetOutline(playerid, gMoneyTextDraw[playerid][3], 0);
    PlayerTextDrawSetProportional(playerid, gMoneyTextDraw[playerid][3], 1);
    PlayerTextDrawSetShadow(playerid, gMoneyTextDraw[playerid][3], 1);
    PlayerTextDrawSetSelectable(playerid, gMoneyTextDraw[playerid][3], 0);

    gMoneyTextDraw[playerid][4] = CreatePlayerTextDraw(playerid,508.000000, 79.000000, "0");
    PlayerTextDrawBackgroundColor(playerid, gMoneyTextDraw[playerid][4], 255);
    PlayerTextDrawFont(playerid, gMoneyTextDraw[playerid][4], 3);
    PlayerTextDrawLetterSize(playerid, gMoneyTextDraw[playerid][4], 0.500000, 1.700000);
    PlayerTextDrawColor(playerid, gMoneyTextDraw[playerid][4], -1);
    PlayerTextDrawSetOutline(playerid, gMoneyTextDraw[playerid][4], 0);
    PlayerTextDrawSetProportional(playerid, gMoneyTextDraw[playerid][4], 1);
    PlayerTextDrawSetShadow(playerid, gMoneyTextDraw[playerid][4], 1);
    PlayerTextDrawSetSelectable(playerid, gMoneyTextDraw[playerid][4], 0);
    return 1;
}

forward MoneyTextDrawUpdate(playerid);
public MoneyTextDrawUpdate(playerid)
{
    new string[16];
    format(string, sizeof(string), "%dLt", GetPlayerMoney(playerid));
    PlayerTextDrawSetString(gMoneyTextDraw[playerid][4], string);
    return 1;
}


public OnPlayerSpawn(playerid)
{
    PlayerTextDrawShow(playerid, gMoneyTextDraw[playerid][0]);
    PlayerTextDrawShow(playerid, gMoneyTextDraw[playerid][1]);
    PlayerTextDrawShow(playerid, gMoneyTextDraw[playerid][2]);
    PlayerTextDrawShow(playerid, gMoneyTextDraw[playerid][3]);
    PlayerTextDrawShow(playerid, gMoneyTextDraw[playerid][4]);
    return 1;
}
I'm not able to run the code right now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)