0% found this document useful (0 votes)
29 views

Codigo RG

The document defines functions for creating and updating player text draws and a text draw to display player information like name, level, money, and skin in a game. It creates the text draws on player connect, updates them on player update, and provides a command to show/hide the player information registers for a player using the created text draws.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Codigo RG

The document defines functions for creating and updating player text draws and a text draw to display player information like name, level, money, and skin in a game. It creates the text draws on player connect, updates them on player update, and provides a command to show/hide the player information registers for a player using the created text draws.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

new Text:Text_RG[1];

new PlayerText:Nomep[MAX_PLAYERS];

new PlayerText:Nivelp[MAX_PLAYERS];

new PlayerText:Skinp[MAX_PLAYERS];

new PlayerText:Dinheirop[MAX_PLAYERS];

new bool:OlhandoRG[MAX_PLAYERS];

public OnGameModeInit()
{

Text_RG[0] = TextDrawCreate(111.647056, 224.416610, "box");


TextDrawLetterSize(Text_RG[0], 0.000000, 15.035296);
TextDrawTextSize(Text_RG[0], 344.000000, 0.000000);
TextDrawAlignment(Text_RG[0], 1);
TextDrawColor(Text_RG[0], -210);
TextDrawUseBox(Text_RG[0], 1);
TextDrawBoxColor(Text_RG[0], 57);
TextDrawSetShadow(Text_RG[0], 0);
TextDrawBackgroundColor(Text_RG[0], 255);
TextDrawFont(Text_RG[0], 1);
TextDrawSetProportional(Text_RG[0], 1);

return 1;
}

public OnPlayerConnect(playerid)
{

Skinp[playerid] = CreatePlayerTextDraw(playerid, 111.117645, 223.833374, "");


PlayerTextDrawTextSize(playerid, Skinp[playerid], 90.000000, 135.000000);
PlayerTextDrawAlignment(playerid, Skinp[playerid], 1);
PlayerTextDrawColor(playerid, Skinp[playerid], -1);
PlayerTextDrawSetShadow(playerid, Skinp[playerid], 0);
PlayerTextDrawBackgroundColor(playerid, Skinp[playerid], 14);
PlayerTextDrawFont(playerid, Skinp[playerid], 5);
PlayerTextDrawSetProportional(playerid, Skinp[playerid], 0);
PlayerTextDrawSetPreviewModel(playerid, Skinp[playerid], 0);
PlayerTextDrawSetPreviewRot(playerid, Skinp[playerid], 0.000000, 0.000000,
0.000000, 1.000000);

Nomep[playerid] = CreatePlayerTextDraw(playerid, 219.411865, 232.583328,


"Nome");
PlayerTextDrawLetterSize(playerid, Nomep[playerid], 0.439529, 1.792500);
PlayerTextDrawAlignment(playerid, Nomep[playerid], 1);
PlayerTextDrawColor(playerid, Nomep[playerid], -1);
PlayerTextDrawSetShadow(playerid, Nomep[playerid], 0);
PlayerTextDrawSetOutline(playerid, Nomep[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Nomep[playerid], 255);
PlayerTextDrawFont(playerid, Nomep[playerid], 1);
PlayerTextDrawSetProportional(playerid, Nomep[playerid], 1);

Nivelp[playerid] = CreatePlayerTextDraw(playerid, 220.353027, 268.166595,


"00");
PlayerTextDrawLetterSize(playerid, Nivelp[playerid], 0.435294, 1.909167);
PlayerTextDrawAlignment(playerid, Nivelp[playerid], 1);
PlayerTextDrawColor(playerid, Nivelp[playerid], -65281);
PlayerTextDrawSetShadow(playerid, Nivelp[playerid], 0);
PlayerTextDrawSetOutline(playerid, Nivelp[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Nivelp[playerid], 255);
PlayerTextDrawFont(playerid, Nivelp[playerid], 2);
PlayerTextDrawSetProportional(playerid, Nivelp[playerid], 1);

Dinheirop[playerid] = CreatePlayerTextDraw(playerid, 220.352966, 310.166687,


"R$_99999999");
PlayerTextDrawLetterSize(playerid, Dinheirop[playerid], 0.423529, 1.815833);
PlayerTextDrawAlignment(playerid, Dinheirop[playerid], 1);
PlayerTextDrawColor(playerid, Dinheirop[playerid], 8388863);
PlayerTextDrawSetShadow(playerid, Dinheirop[playerid], 0);
PlayerTextDrawSetOutline(playerid, Dinheirop[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, Dinheirop[playerid], 255);
PlayerTextDrawFont(playerid, Dinheirop[playerid], 1);
PlayerTextDrawSetProportional(playerid, Dinheirop[playerid], 1);
return 1;
}

public OnPlayerUpdate(playerid)
{

new string[2000], skin;

format(string, 2000, "%s", pName(playerid));

PlayerTextDrawSetString(playerid, Nomep[playerid], string);

format(string, 2000, "Nivel:%d", GetPlayerScore(playerid));

PlayerTextDrawSetString(playerid, Nivelp[playerid], string);

format(string, 2000, "R$:%d", GetPlayerMoney(playerid));

PlayerTextDrawSetString(playerid, Dinheirop[playerid], string);

skin = GetPlayerSkin(playerid);

PlayerTextDrawSetPreviewModel(playerid, Skinp[playerid], skin);


return 1;
}

CMD:rg(playerid)
{
if(OlhandoRG[playerid] == true) return SumirRG(playerid), OlhandoRG[playerid] =
false;

new string[2000], skin;

format(string, 2000, "%s", pName(playerid));

PlayerTextDrawSetString(playerid, Nomep[playerid], string);

format(string, 2000, "Nivel:%d", GetPlayerScore(playerid));

PlayerTextDrawSetString(playerid, Nivelp[playerid], string);


format(string, 2000, "R$:%d", GetPlayerMoney(playerid));

PlayerTextDrawSetString(playerid, Dinheirop[playerid], string);

skin = GetPlayerSkin(playerid);

PlayerTextDrawSetPreviewModel(playerid, Skinp[playerid], skin);

TextDrawShowForPlayer(playerid, Text_RG[0]);

PlayerTextDrawShow(playerid, Nomep[playerid]);

PlayerTextDrawShow(playerid, Nivelp[playerid]);

PlayerTextDrawShow(playerid, Skinp[playerid]);

PlayerTextDrawShow(playerid, Dinheirop[playerid]);

OlhandoRG[playerid] = true;

return 1;
}
stock SumirRG(playerid)
{
TextDrawHideForPlayer(playerid, Text_RG[0]);

PlayerTextDrawHide(playerid, Nomep[playerid]);

PlayerTextDrawHide(playerid, Nivelp[playerid]);

PlayerTextDrawHide(playerid, Skinp[playerid]);

PlayerTextDrawHide(playerid, Dinheirop[playerid]);

return 1;
}

You might also like