13.08.2011, 21:07
Jonathan fiz um streamer simples para 3DTextLabels
pawn Код:
#define MaxLabels (2000)
#define MaxStringSize (128)
new
Texto[MaxLabels][MaxStringSize],
Float:Pos[MaxLabels][4],
_Info[MaxLabels][3],
PlayerText3D:Label[MaxLabels],
Labels
;
Text3D:Create3DTextLabelEx(text[], color, Float:X, Float:Y, Float:Z, Float:DrawDistance)
{
Labels++;
format(Texto[Labels],128,"%s",text);
Pos[Labels][0] = X;
Pos[Labels][1] = Y;
Pos[Labels][2] = Z;
Pos[Labels][3] = DrawDistance;
_Info[Labels][2] = color;
return 1;
}
public OnPlayerSpawn(playerid)
{
SetTimerEx("OnPlayerNear3DTextLabel",1500,true,"i",playerid);
return 1;
}
forward OnPlayerNear3DTextLabel(playerid);
public OnPlayerNear3DTextLabel(playerid)
{
for(new i; i < ( Labels + 1 ); ++i )
{
if(IsPlayerInRangeOfPoint(playerid,_Info[i][0],Pos[Labels][0],Pos[Labels][1],Pos[Labels][2]))
{
Label[i] = Create3DPlayerTextLabel(playerid,Texto[i],_Info[i][2],Pos[i][0],Pos[i][1],Pos[i][2],_Info[i]);
}
else
{
DeletePlayer3DTextLabel(playerid,Label[i]);
}
}
return 1;
}