11.03.2013, 12:33
pawn Код:
new PlayerText:BLOCKINFO[MAX_PLAYERS];
public OnPlayerConnect(playerid)
{
MakePlayerTextDraw(playerid);
PlayerTextDrawShow(playerid,BLOCKINFO[playerid]);
SetPlayerTimerEx("UpdateCubes",7000,false,"i",playerid);
}
forward UpdateCubes(i);
public UpdateCubes(i)
{
if(BlockID[i] != -1) format(stringu, sizeof(stringu), "~w~Selected block:~n~~p~~h~~h~~h~%s",CUBE_NAME[BlockID[i]-1]);
else format(stringu, sizeof(stringu), "~w~Selected block:~n~~p~~h~~h~~h~None");
PlayerTextDrawSetString(i,BLOCKINFO[i],stringu);
return 1;
}
stock MakePlayerTextDraw(playerid)
{
BLOCKINFO[playerid] = CreatePlayerTextDraw(playerid, 509.000000, 379.750091, "Selected block:~n~wait");
PlayerTextDrawLetterSize(playerid, BLOCKINFO[playerid], 0.449999, 1.600000);
PlayerTextDrawTextSize(playerid, BLOCKINFO[playerid], 634.599792, 701.399658);
PlayerTextDrawAlignment(playerid, BLOCKINFO[playerid], 1);
PlayerTextDrawColor(playerid, BLOCKINFO[playerid], -1);
PlayerTextDrawUseBox(playerid, BLOCKINFO[playerid], true);
PlayerTextDrawBoxColor(playerid, BLOCKINFO[playerid], -2147483393);
PlayerTextDrawSetShadow(playerid, BLOCKINFO[playerid], 0);
PlayerTextDrawSetOutline(playerid, BLOCKINFO[playerid], 1);
PlayerTextDrawBackgroundColor(playerid, BLOCKINFO[playerid], -1523963137);
PlayerTextDrawFont(playerid, BLOCKINFO[playerid], 1);
PlayerTextDrawSetProportional(playerid, BLOCKINFO[playerid], 1);
return 1;
}