18.07.2015, 06:39
PlayerTextDraw foi feito exatamente para isto. Vamos simplificar.
PHP код:
#include <a_samp>
#include <zcmd>
#define PLAYERS 200
new PlayerText:Name[MAX_PLAYERS];
new bool:loggedFirstTime[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
loggedFirstTime[playerid] = true;
Name[playerid] = CreatePlayerTextDraw(playerid, 1.000000, 328.000000," ");
PlayerTextDrawBackgroundColor(playerid, Name[playerid], 255);
PlayerTextDrawFont(playerid, Name[playerid], 2);
PlayerTextDrawLetterSize(playerid, Name[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid, Name[playerid], 16711935);
PlayerTextDrawSetOutline(playerid, Name[playerid], 1);
PlayerTextDrawSetProportional(playerid, Name[playerid], 1);
new playerName[MAX_PLAYER_NAME], str[MAX_PLAYER_NAME + 10];
GetPlayerName(playerid, playerName, sizeof(playerName));
format(str, sizeof(str), "Nick: ~b~%s", playerName);
PlayerTextDrawSetString(playerid, Name[playerid], str);
return 1;
}
public OnPlayerSpawn(playerid)
{
if(loggedFirstTime[playerid]) {
loggedFirstTime[playerid] = false;
PlayerTextDrawShow(playerid, Name[playerid]);
}
return 1;
}
COMMAND:pnhaoff(playerid,params[])
{
PlayerTextDrawHide(playerid, Name[playerid]);
return 1;
}