Ime igraca u TextDrawu

Započeo Zarko55, April 09, 2020, 11:27:50 PRE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Problem(error/warning): Naime uzeo da napravim u TD-u da bude ime igraca , i gledao sam po forumu kako si likovi radili ali sve sto sam probao nije radilo , nema errora/warninga ali uopste se ne pojavljuje u TD-u
Dio skripte: [pawn]ImeIgracaTD[playerid] = CreatePlayerTextDraw(playerid, 548.000000, 164.696289, "Ime_Igraca");
   PlayerTextDrawLetterSize(playerid, ImeIgracaTD[playerid], 0.141666, 0.836740);
   PlayerTextDrawAlignment(playerid, ImeIgracaTD[playerid], 1);
   PlayerTextDrawColor(playerid, ImeIgracaTD[playerid], -1);
   PlayerTextDrawSetShadow(playerid, ImeIgracaTD[playerid], 0);
   PlayerTextDrawSetOutline(playerid, ImeIgracaTD[playerid], 0);
   PlayerTextDrawBackgroundColor(playerid, ImeIgracaTD[playerid], 255);
   PlayerTextDrawFont(playerid, ImeIgracaTD[playerid], 2);
   PlayerTextDrawSetProportional(playerid, ImeIgracaTD[playerid], 1);
   PlayerTextDrawSetShadow(playerid, ImeIgracaTD[playerid], 0);[/pawn]

[pawn]new string[24];
          format(string, sizeof(string), "%d",ImeIgraca(playerid));
     PlayerTextDrawSetString(playerid, ImeIgracaTD[playerid], string);[/pawn]

Debug iz server_log(ukoliko je u pitanju crashanje servera - crashdetect log): //
Slika/video ingame problema(obavezno ako je ingame problem)://

[pawn]
forward [MAX_PLAYER_NAME + 1]PlayerName(playerid);
stock PlayerName(playerid)
{
   #assert MAX_PLAYER_NAME + 1 == 25
   #emit PUSH.C 25
   #emit PUSH.S 16
   #emit PUSH.S playerid
   #emit PUSH.C 12
   #emit SYSREQ.C GetPlayerName
   #emit STACK 16
   #emit RETN
}

public OnPlayerConnect(playerid)
{
    ImeIgracaTD[playerid] = CreatePlayerTextDraw(playerid, 548.000000, 164.696289, PlayerName(playerid));
    PlayerTextDrawLetterSize(playerid, ImeIgracaTD[playerid], 0.141666, 0.836740);
    PlayerTextDrawAlignment(playerid, ImeIgracaTD[playerid], 1);
    PlayerTextDrawColor(playerid, ImeIgracaTD[playerid], -1);
    PlayerTextDrawSetShadow(playerid, ImeIgracaTD[playerid], 0);
    PlayerTextDrawSetOutline(playerid, ImeIgracaTD[playerid], 0);
    PlayerTextDrawBackgroundColor(playerid, ImeIgracaTD[playerid], 255);
    PlayerTextDrawFont(playerid, ImeIgracaTD[playerid], 2);
    PlayerTextDrawSetProportional(playerid, ImeIgracaTD[playerid], 1);
    PlayerTextDrawSetShadow(playerid, ImeIgracaTD[playerid], 0);
    return 1;
}

// Dole stavis kada se igrac uloguje ili gde vec hoces da ti prikazuje taj td:
PlayerTextDrawShow(playerid, ImeIgracaTD[playerid]);
[/pawn]

probaj ovako

[pawn]new ime[ MAX_PLAYER_NAME + 1 ];
format( ime, sizeof(ime), "%s", ImeIgraca( playerid ) );
PlayerTextDrawSetString(playerid, ImeIgracaTD[ playerid ], ime);[/pawn]

Citat: Miki11 poslato April 09, 2020, 14:12:52 POSLE PODNE
probaj ovako

[pawn]new ime[ MAX_PLAYER_NAME + 1 ];
format( ime, sizeof(ime), "%s", ImeIgraca( playerid ) );
PlayerTextDrawSetString(playerid, ImeIgracaTD[ playerid ], ime);[/pawn]

Hvala radi !