new Text3D:Gang3d3[MAX_PLAYERS]; public onplayerupdate(playerid) { if(PlayerInfo[playerid][pMember] == 1 ||PlayerInfo[playerid][pLeader] == 1) { format(sStr, sizeof(sStr),"Dell"); Update3DTextLabelText(Gang3d3[playerid], 0xFFFFFF, ""); Gang3d3[playerid] = Create3DTextLabel( sStr,COLOR_WHITE, 30.0,40.0,50.0,50.0,0); Attach3DTextLabelToPlayer( Gang3d3[playerid],playerid, 0.0, 0.0, 0.3); } if(PlayerInfo[playerid][pMember] == 2||PlayerInfo[playerid][pLeader] == 2) { format(sStr, sizeof(sStr),"Acer"); Update3DTextLabelText(Gang3d3[playerid], 0x0000F9FF, ""); Gang3d3[playerid] = Create3DTextLabel( sStr, 0x0000F9FF, 30.0,40.0,50.0,50.0,0); Attach3DTextLabelToPlayer(Gang3d3[playerid],playerid, 0.0, 0.0, 0.3); } } public OnPlayerConnect(playerid) { Delete3DTextLabel(Gang3d3[playerid]); } public OnPlayerDisconnect(playerid,reason) { Delete3DTextLabel(Gang3d3[playerid]); } /// and on my exist guild Delete3DTextLabel(Gang3d3[playerid]);
You're creating millions of text labels, you should create it in OnPlayerConnect, not in OnPlayerUpdate.
If the player has 60 FPS, OnPlayerUpdate will be called 60 times a second, which means it'll create 60 3DTextLabels and attach it to the same player 60 times a second. |
new Text3D:Gang3d3[MAX_PLAYERS]; public OnPlayerConnect(playerid) { new Float:X, Float:Y, Float:Z; new sStr[100]; GetPlayerPos(playerid,X,Y,Z); if(PlayerInfo[playerid][pMember] == 1 ||PlayerInfo[playerid][pLeader] == 1)//µУГЗЁ { format(sStr, sizeof(sStr),"Acer"); Gang3d3[playerid] = Create3DTextLabel( sStr, 0x0000F9FF, 30.0,40.0,50.0,50.0,0); Attach3DTextLabelToPlayer(Gang3d3[playerid],playerid, 0.0, 0.0, 0.3); } if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2) { format(sStr, sizeof(sStr),"Dell"); Gang3d3[playerid] = Create3DTextLabel( sStr, 10079487, 30.0,40.0,50.0,50.0,0); Attach3DTextLabelToPlayer(Gang3d3[playerid], playerid,0.0, 0.0, 0.3); } } public OnPlayerDisconnect(playerid,reason) { Delete3DTextLabel(Gang3d3[playerid]); } |
If the player has 60 FPS, OnPlayerUpdate will be called 60 times a second
|