new Text:Teste;
// OnGameModeInit
Teste = TextDrawCreate(290.000000, 190.000000, "TextDraw 1");
TextDrawLetterSize(Teste, 0.400000, 1.600000);
TextDrawAlignment(Teste, 1);
TextDrawColor(Teste, -1);
TextDrawFont(Teste, 1);
TextDrawSetProportional(Teste, 1);
// OnPlayerCommandText
if(strcmp(cmdtext, "/text", true) == 0)
{
SendClientMessage(playerid, 0xFF000FF, "Textdraw setada");
TextDrawShowForPlayer(playerid, Teste);
return 1;
}
#include a_samp
new Text:Teste[MAX_PLAYERS];
// OnGameModeInit
public OnFilterScriptInit()
{
for(new x = 0; x < MAX_PLAYERS; x++)
{
Teste[x] = TextDrawCreate(290.000000, 190.000000, "TextDraw 1");
TextDrawLetterSize(Teste[x], 0.400000, 1.600000);
TextDrawAlignment(Teste[x], 1);
TextDrawColor(Teste[x], -1);
TextDrawFont(Teste[x], 1);
TextDrawSetProportional(Teste[x], 1);
}
return 1;
}
// OnPlayerCommandText
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/td", cmdtext, true) == 0)
{
SendClientMessage(playerid, -1, "Textdraw setada");
TextDrawShowForPlayer(playerid, Teste[playerid]);
return 1;
}
return 0;
}
TextDrawShowForAll(Teste);
й uma textdraw sem MAX_PLAYERS nгo pode ser playerid PHP код:
|
#include a_samp
new Text:Teste;
// OnGameModeInit
public OnPlayerConnect(playerid)
{
Teste = TextDrawCreate(290.000000, 190.000000, "TextDraw 1");
TextDrawLetterSize(Teste, 0.400000, 1.600000);
TextDrawAlignment(Teste, 1);
TextDrawColor(Teste, -1);
TextDrawFont(Teste, 1);
TextDrawSetProportional(Teste, 1);
return 1;
}
// OnPlayerCommandText
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/td", cmdtext, true) == 0)
{
SendClientMessage(playerid, -1, "Textdraw setada");
TextDrawShowForPlayer(playerid, Teste);
return 1;
}
return 0;
}