new Text:Name[ MAX_PLAYERS ];
for( new i = 0; i < MAX_PLAYERS; ++i )
{
Name[ i ] = TextDrawCreate(1.000000, 328.000000," ");
TextDrawBackgroundColor(Name[ i ], 255);
TextDrawFont(Name[ i ], 2);
TextDrawLetterSize(Name[ i ], 0.500000, 1.000000);
TextDrawColor(Name[ i ], 16711935);
TextDrawSetOutline(Name[ i ], 1);
TextDrawSetProportional(Name[ i ], 1);
}
foreach(Player, i )
{
if(IsPlayerConnected(i))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(i, name,sizeof(name));
format(strt,sizeof(strt),"Nick: ~b~%s",name( i ));
TextDrawSetString(Name[ i ],strt);
}
return 1;
}
new Text:Name[ MAX_PLAYERS ];
for( new i = 0; i < MAX_PLAYERS; ++i )
{
Name[ i ] = TextDrawCreate(1.000000, 328.000000," ");
TextDrawBackgroundColor(Name[ i ], 255);
TextDrawFont(Name[ i ], 2);
TextDrawLetterSize(Name[ i ], 0.500000, 1.000000);
TextDrawColor(Name[ i ], 16711935);
TextDrawSetOutline(Name[ i ], 1);
TextDrawSetProportional(Name[ i ], 1);
}
SetTimer( "NickInfo", 5000, false );
forward NickInfo( );
public NickInfo( )
{
foreach(Player, i )
{
new strt[256];
format( strt, sizeof( strt ), "Nick: ~b~%s ~w~ID: ~b~%d" , PlayerName( i ), i );
TextDrawSetString( Name[ i ], strt );
}
return 1;
}
TextDrawShowForPlayer( playerid, Name[ playerid ] );
#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;
}
new
PlayerText:MeuNick[MAX_PLAYERS],
Nick[24],
Format[50]
;
MeuNick[playerid] = CreatePlayerTextDraw(playerid,1.000000, 328.000000," ");
PlayerTextDrawBackgroundColor(playerid,MeuNick[playerid], 255);
PlayerTextDrawFont(playerid,MeuNick[playerid], 2);
PlayerTextDrawLetterSize(playerid,MeuNick[playerid], 0.500000, 1.000000);
PlayerTextDrawColor(playerid,MeuNick[playerid], 16711935);
PlayerTextDrawSetOutline(playerid,MeuNick[playerid], 1);
PlayerTextDrawSetProportional(playerid,MeuNick[playerid], 1);
if(IsPlayerConnected(playerid)){
GetPlayerName(playerid, Nick, sizeof(Nick));
format(Format, sizeof(Format), "Nick: %s", Nick);
PlayerTextDrawSetString(playerid, MeuNick[playerid], Format);
PlayerTextDrawShow(playerid, PlayerText:MeuNick[playerid]);
}
PlayerTextDrawDestroy(playerid, MeuNick[playerid]); // Destruir text draw ao desconectar
Para Terminar em OnPlayerDisconnect
PHP код:
|
Vocк disse exatamente o que eu disse, sу que com algumas coisas erradas.
|