Jump to content
  • 0

Problema script


AndreiADV

Question

Am vrut sa fac un PayDay pe textdraw si imi da errorile acestea!

:error 028: invalid subscript (not an array or too many subscripts): "PayDayTD"

: error 001: expected token: ";", but found "]"

: fatal error 107: too many error messages on one line

Mai jos va las ce am facut pentru textdraw!

1.Am facut acest timer 

SetTimer("hidePayday", 15000, false);

function hidePayday() {
    forach(Player, i) {
        if(IsPlayerConnected(i) && gPlayerLogged[i] == 1) PlayerTextDrawHide(i, PayDayTD);
    }
    return true;}

2.Mai sus in function PayDay()

 format(string, sizeof(string), "PayDay~n~Ore Jucate: +%0.2f~n~PayCheck: $%s~n~Bank: $%s~n~Taxe: $%s~n~PayDay", PlayerInfo[i][pPayDay] / 3600.0, FormatNumber(paycheck), FormatNumber(PlayerInfo[i][pAccount]), FormatNumber(TaxValue), Float: PlayerInfo[i][pConnectTime]);

PlayerTextDrawSetString(playerid, PayDayTD, string);
        PlayerTextDrawShow(playerid, PayDayTD);

3.Mai sus pe la inceputul GM la-am definit!

new PlayerText: PayDayTD

 

Si acum nu inteleg care este problema! Ma puteti ajuta?

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

În primul rând, nu ai definit cum trebuie player text-ul. Acesta trebuie definit in felul următor: new PlayerText: PayDayTD[MAX_PLAYERS]; .

Pentru funcțiile „PlayerTextDrawSetString” și „PlayerTextDrawShow” modifică astfel:

PlayerTextDrawSetString(playerid, PayDayTD[playerid], string);
PlayerTextDrawShow(playerid, PayDayTD[playerid]);

Iar foreach-ul pentru funcția hidePayDay() îi lipsește „e”-ul:

function hidePayday() {
	foreach(Player, i) {
		if(IsPlayerConnected(i) && gPlayerLogged[i] == 1) PlayerTextDrawHide(i, PayDayTD[i]);
	}
	return true;
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.