[Ajuda] Textdraw
#1

Estou com error de compilar


PHP код:
error 017undefined symbol "Textdraw0"
 
warning 215expression has no effect
 
error 001expected token";"but found "]"
 
error 029invalid expressionassumed zero
 
fatal error 107too many error messages on one line 


pawn Код:
new Text:Textdraw[6][MAX_PLAYERS];


]main()
{
    print("\n----------------------------------");
    print("Iniciado");
    print("----------------------------------\n");
}



public OnGameModeInit()
{
    SetTimer("UpdateTimer", 1000, true);
    SetGameModeText("My Gaemode");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);

    return 1;
}

public OnGameModeExit()
{
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
    SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
    return 1;
}

public OnPlayerConnect(playerid)
{
    Textdraw0[playerid] = TextDrawCreate(641.375000, 429.666687, "usebox");
    TextDrawLetterSize(Textdraw0, 0.000000, 1.822222);
    TextDrawTextSize(Textdraw0, -2.000000, 0.000000);
    TextDrawAlignment(Textdraw0, 1);
    TextDrawColor(Textdraw0, 0);
    TextDrawUseBox(Textdraw0, true);
    TextDrawBoxColor(Textdraw0, 102);
    TextDrawSetShadow(Textdraw0, 0);
    TextDrawSetOutline(Textdraw0, 0);
    TextDrawFont(Textdraw0, 0);

    Textdraw1[playerid] = TextDrawCreate(4.375000, 429.916687, "SCORE:");
    TextDrawLetterSize(Textdraw1, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw1, 1);
    TextDrawColor(Textdraw1, -2139062017);
    TextDrawSetShadow(Textdraw1, 0);
    TextDrawSetOutline(Textdraw1, 1);
    TextDrawBackgroundColor(Textdraw1, 51);
    TextDrawFont(Textdraw1, 3);
    TextDrawSetProportional(Textdraw1, 1);

    Textdraw2[playerid] = TextDrawCreate(110.000000, 430.500030, "DINHEIRO:");
    TextDrawLetterSize(Textdraw2, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw2, 1);
    TextDrawColor(Textdraw2, -2139062017);
    TextDrawSetShadow(Textdraw2, 0);
    TextDrawSetOutline(Textdraw2, 1);
    TextDrawBackgroundColor(Textdraw2, 51);
    TextDrawFont(Textdraw2, 3);
    TextDrawSetProportional(Textdraw2, 1);

    Textdraw3[playerid] = TextDrawCreate(225.625000, 430.499969, "KILLS:");
    TextDrawLetterSize(Textdraw3, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw3, 1);
    TextDrawColor(Textdraw3, -2139062017);
    TextDrawSetShadow(Textdraw3, 0);
    TextDrawSetOutline(Textdraw3, 1);
    TextDrawBackgroundColor(Textdraw3, 51);
    TextDrawFont(Textdraw3, 3);
    TextDrawSetProportional(Textdraw3, 1);

    Textdraw4[playerid] = TextDrawCreate(314.375000, 430.500152, "DEATHS:");
    TextDrawLetterSize(Textdraw4, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw4, 1);
    TextDrawColor(Textdraw4, -2139062017);
    TextDrawSetShadow(Textdraw4, 0);
    TextDrawSetOutline(Textdraw4, 1);
    TextDrawBackgroundColor(Textdraw4, 51);
    TextDrawFont(Textdraw4, 3);
    TextDrawSetProportional(Textdraw4, 1);

    Textdraw5[playerid] = TextDrawCreate(415.625000, 429.916564, "FPS:");
    TextDrawLetterSize(Textdraw5, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw5, 1);
    TextDrawColor(Textdraw5, -2139062017);
    TextDrawSetShadow(Textdraw5, 0);
    TextDrawSetOutline(Textdraw5, 1);
    TextDrawBackgroundColor(Textdraw5, 51);
    TextDrawFont(Textdraw5, 3);
    TextDrawSetProportional(Textdraw5, 1);

    Textdraw6[playerid] = TextDrawCreate(488.125000, 429.333312, "PING:");
    TextDrawLetterSize(Textdraw6, 0.449999, 1.600000);
    TextDrawAlignment(Textdraw6, 1);
    TextDrawColor(Textdraw6, -2139062017);
    TextDrawSetShadow(Textdraw6, 0);
    TextDrawSetOutline(Textdraw6, 1);
    TextDrawBackgroundColor(Textdraw6, 51);
    TextDrawFont(Textdraw6, 3);
    TextDrawSetProportional(Textdraw6, 1);
    return 1;
}

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    for(new i=0;i<MAX_PLAYERS;i++)
    TextDrawDestroy(i[playerid]);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    for(new i=0;i<MAX_PLAYERS;i++)
    TextDrawShowForPlayer(playerid, i[playerid]);
    return 1;
}

pawn Код:
forward UpdateTimer(); //Must always forward a timer, read the set timer topic in the wiki for more info.
public UpdateTimer() // Must be a public.
{

    for(new x; x<MAX_PLAYERS; x++) // Loop for all players
    {
        if(!IsPlayerConnected(x));
        Score = GetPlayerScore(x), Money = GetPlayerMoney(x), Ping = GetPlayerPing(x);
        new TDstring[150];
        format(TDstring, sizeof(TDstring), "SCORE %d, DINHEIRO %d, KILLS %d, DEATHS %d, FPS %d, PING %d", Score, Money, Ping);
        TextDrawSetString(Textdraw0[x], TDstring);
    }
    return 1;
}
Reply
#2

sintaxe errada.

onde tem por exemplo: Textdraw0
vc substitui por: Textdraw[0]

entende?
Reply
#3

pawn Код:
C:\Users\Leonardo\Desktop\Guerra em Los Santos\pawno\include\sscanf2.inc(203) : error 017: undefined symbol "SSCANF_OnPlayerConnect"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\pawno\include\sscanf2.inc(227) : error 017: undefined symbol "SSCANF_OnPlayerDisconnect"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(40) : warning 217: loose indentation
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(40) : error 029: invalid expression, assumed zero
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(40) : error 004: function "OnPlayerRequestClass" is not implemented
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(42) : error 017: undefined symbol "playerid"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(43) : error 017: undefined symbol "playerid"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(44) : error 017: undefined symbol "playerid"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(48) : warning 225: unreachable code
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(48) : error 029: invalid expression, assumed zero
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(48) : error 004: function "SSCANF_OnPlayerConnect" is not implemented
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(50) : error 017: undefined symbol "playerid"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(51) : error 017: undefined symbol "Textdraw0"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(52) : error 017: undefined symbol "Textdraw0"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(53) : error 017: undefined symbol "Textdraw0"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(54) : error 017: undefined symbol "Textdraw0"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(55) : error 017: undefined symbol "Textdraw0"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(56) : error 017: undefined symbol "Textdraw0"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(57) : error 017: undefined symbol "Textdraw0"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(58) : error 017: undefined symbol "Textdraw0"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(59) : error 017: undefined symbol "Textdraw0"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(61) : error 017: undefined symbol "playerid"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(62) : error 017: undefined symbol "Textdraw1"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(63) : error 017: undefined symbol "Textdraw1"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(64) : error 017: undefined symbol "Textdraw1"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(65) : error 017: undefined symbol "Textdraw1"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(66) : error 017: undefined symbol "Textdraw1"
C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(67) : error 017: undefined symbol "Textdraw1"

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.

PHP код:
extdraw[1][playerid] = TextDrawCreate(4.375000429.916687"SCORE:");
    
TextDrawLetterSize(Textdraw10.4499991.600000);
    
TextDrawAlignment(Textdraw11);
    
TextDrawColor(Textdraw1, -2139062017);
    
TextDrawSetShadow(Textdraw10);
    
TextDrawSetOutline(Textdraw11);
    
TextDrawBackgroundColor(Textdraw151);
    
TextDrawFont(Textdraw13);
    
TextDrawSetProportional(Textdraw11
Reply
#4

Quote:

C:\Users\Leonardo\Desktop\Guerra em Los Santos\gamemodes\Serve Agora.pwn(67) : error 017: undefined symbol "Textdraw1"

pelo que eu vi vocк nгo criou a variavel, ou estou errado ?, Se a variavel nгo tiver criada crie-a

Topo Do Gamemode:

PHP код:
new Text:Textdraw1
Desculpe se estiver errado, sou novato...
Reply
#5

consertando esse cуdigo:

Код:
    Textdraw[1][playerid] = TextDrawCreate(4.375000, 429.916687, "SCORE:");
    TextDrawLetterSize(Textdraw[1], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[1], 1);
    TextDrawColor(Textdraw[1], -2139062017);
    TextDrawSetShadow(Textdraw[1], 0);
    TextDrawSetOutline(Textdraw[1], 1);
    TextDrawBackgroundColor(Textdraw[1], 51);
    TextDrawFont(Textdraw[1], 3);
    TextDrawSetProportional(Textdraw[1], 1);
Esse й o modelo
Reply
#6

Adicione ao topo

PHP код:
#include a_samp 
Reply
#7

Ja ta tudo vo baixar uns fs e olhar nгo sou muito experiente em textdraws.
Reply
#8

Use o Zamaroth TextDraw Editor, й уtimo.
Reply
#9

Estude mais sobre variavel, vocк tinha feito todas elas errada .


Agora pode compilar sem poblemas .


pawn Код:
#define FILTERSCRIPT
#include <a_samp>

#if defined FILTERSCRIPT

new Text:Textdraw[7][MAX_PLAYERS]; // se tiver 6 Variavel aqui entгo sera 7 ! .


public OnFilterScriptInit()
{
    SetTimer("UpdateTimer", 1000, true);
    for(new i=0; i<GetMaxPlayers(); i++)
    {
    Textdraw[0][i] = TextDrawCreate(641.375000, 429.666687, "usebox"); //OBS: Textdraw[0] e Nгo Textdraw0 Entendeu ?
    TextDrawLetterSize(Textdraw[0][i], 0.000000, 1.822222);
    TextDrawTextSize(Textdraw[0][i], -2.000000, 0.000000);
    TextDrawAlignment(Textdraw[0][i], 1);
    TextDrawColor(Textdraw[0][i], 0);
    TextDrawUseBox(Textdraw[0][i], true);
    TextDrawBoxColor(Textdraw[0][i], 102);
    TextDrawSetShadow(Textdraw[0][i], 0);
    TextDrawSetOutline(Textdraw[0][i], 0);
    TextDrawFont(Textdraw[0][i], 0);

    Textdraw[1][i] = TextDrawCreate(4.375000, 429.916687, "SCORE:");
    TextDrawLetterSize(Textdraw[1][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[1][i], 1);
    TextDrawColor(Textdraw[1][i], -2139062017);
    TextDrawSetShadow(Textdraw[1][i], 0);
    TextDrawSetOutline(Textdraw[1][i], 1);
    TextDrawBackgroundColor(Textdraw[1][i], 51);
    TextDrawFont(Textdraw[1][i], 3);
    TextDrawSetProportional(Textdraw[1][i], 1);

    Textdraw[2][i] = TextDrawCreate(110.000000, 430.500030, "DINHEIRO:");
    TextDrawLetterSize(Textdraw[2][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[2][i], 1);
    TextDrawColor(Textdraw[2][i], -2139062017);
    TextDrawSetShadow(Textdraw[2][i], 0);
    TextDrawSetOutline(Textdraw[2][i], 1);
    TextDrawBackgroundColor(Textdraw[2][i], 51);
    TextDrawFont(Textdraw[2][i], 3);
    TextDrawSetProportional(Textdraw[2][i], 1);

    Textdraw[3][i] = TextDrawCreate(225.625000, 430.499969, "KILLS:");
    TextDrawLetterSize(Textdraw[3][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[3][i], 1);
    TextDrawColor(Textdraw[3][i], -2139062017);
    TextDrawSetShadow(Textdraw[3][i], 0);
    TextDrawSetOutline(Textdraw[3][i], 1);
    TextDrawBackgroundColor(Textdraw[3][i], 51);
    TextDrawFont(Textdraw[3][i], 3);
    TextDrawSetProportional(Textdraw[3][i], 1);

    Textdraw[4][i] = TextDrawCreate(314.375000, 430.500152, "DEATHS:");
    TextDrawLetterSize(Textdraw[4][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[4][i], 1);
    TextDrawColor(Textdraw[4][i], -2139062017);
    TextDrawSetShadow(Textdraw[4][i], 0);
    TextDrawSetOutline(Textdraw[4][i], 1);
    TextDrawBackgroundColor(Textdraw[4][i], 51);
    TextDrawFont(Textdraw[4][i], 3);
    TextDrawSetProportional(Textdraw[4][i], 1);

    Textdraw[5][i] = TextDrawCreate(415.625000, 429.916564, "FPS:");
    TextDrawLetterSize(Textdraw[5][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[5][i], 1);
    TextDrawColor(Textdraw[5][i], -2139062017);
    TextDrawSetShadow(Textdraw[5][i], 0);
    TextDrawSetOutline(Textdraw[5][i], 1);
    TextDrawBackgroundColor(Textdraw[5][i], 51);
    TextDrawFont(Textdraw[5][i], 3);
    TextDrawSetProportional(Textdraw[5][i], 1);

    Textdraw[6][i] = TextDrawCreate(488.125000, 429.333312, "PING:");
    TextDrawLetterSize(Textdraw[6][i], 0.449999, 1.600000);
    TextDrawAlignment(Textdraw[6][i], 1);
    TextDrawColor(Textdraw[6][i], -2139062017);
    TextDrawSetShadow(Textdraw[6][i], 0);
    TextDrawSetOutline(Textdraw[6][i], 1);
    TextDrawBackgroundColor(Textdraw[6][i], 51);
    TextDrawFont(Textdraw[6][i], 3);
    TextDrawSetProportional(Textdraw[6][i], 1);
    }
    return 1;
}

public OnFilterScriptExit()
{
    return 1;
}

public OnPlayerConnect(playerid)
{
    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    for(new i = 0; i < 7; i++) TextDrawHideForPlayer(playerid, Textdraw[i][playerid]);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    for(new i = 0; i < 7; i++) TextDrawShowForPlayer(playerid, Textdraw[i][playerid]);
    return 1;
}


forward UpdateTimer(); //Must always forward a timer, read the set timer topic in the wiki for more info.
public UpdateTimer() // Must be a public.
{

       for(new x; x<MAX_PLAYERS; x++) // Loop for all players
       {
       new TDstring[128],Score,Money,Ping;
       if(!IsPlayerConnected(x)){
       Score = GetPlayerScore(x), Money = GetPlayerMoney(x), Ping = GetPlayerPing(x);
       format(TDstring, sizeof(TDstring), "SCORE %d, DINHEIRO %d, KILLS %d, DEATHS %d, FPS %d, PING %d", Score, Money, Ping);
       TextDrawSetString(Textdraw[0][x], TDstring);
       }
       }
       return 1;
}

#endif
Reply
#10

26 Erros ja fiz isso.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)