25.06.2012, 17:46
Hi, I deleted the normal name tags (ShowNameTags(0)), and I used the 3DTextLabels (with Incognito's Streamer Plugin) to have the Name Tags. But in some Times the names change. For example Player2 has the name of Player1 and Player1 doesn't have the name.
This is the function:
OnPlayerConnect:
OnGameModeInit:
OnPlayerDisconnect:
Some words are italian, but doesn't matter because they are only string
This is the function:
Код:
enum PA { Text3D: pnlabel } new PlayerAccount[MAX_PLAYERS][PA];
Код:
if(!IsPlayerNPC(playerid)) { PlayerAccount[playerid][pnlabel] = CreateDynamic3DTextLabel(PlayerAccount[playerid][Name],0xDCEAE9FF, 0.0, 0.0, 0.0, 15, playerid,-1, 1); }
Код:
SetTimer("DrugTime", 9000, true);
Код:
DestroyDynamic3DTextLabel(PlayerAccount[playerid][pnlabel]);
Код:
forward DrugTime(); public DrugTime() { for(new i = 0; i < MAX_PLAYERS; i++) { if(PlayerAccount[i][Logged]) { new Float:health, namedstring[60]; GetPlayerHealth(i,health); format(namedstring, 55, "%s", PlayerAccount[i][Name]); if(PlayerAccount[i][wearingmask] == 1){ format(namedstring, sizeof(namedstring), "Sconosciuto #%d",PlayerAccount[i][ID]); } UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0xDCEAE9FF, namedstring); if (health >= 65.0 && Drinking[i]==0) { SetPlayerDrunkLevel(i, 0); if(PlayerAccount[i][wearingmask] == 1){ format(namedstring, sizeof(namedstring), "Sconosciuto #%d",PlayerAccount[i][ID]); } UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0xDCEAE9FF, namedstring); } else if (health <= 65.0 && health > 45 && Antidolor[i]==0) { if(PlayerAccount[i][wearingmask] == 1){ format(namedstring, sizeof(namedstring), "Sconosciuto #%d",PlayerAccount[i][ID]); } UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0xFFDC00FF, namedstring); } else if (health <= 45.0 && health > 30 && Antidolor[i] == 0) { if(random(1)==0){ if(!IsPlayerInAnyVehicle(i)) { ApplyAnimation(i,"SWEET","Sweet_injuredloop",4.0,1,0,0,0,6000,1); //anim injured } if(PlayerAccount[i][wearingmask] == 1){ format(namedstring, sizeof(namedstring), "Sconosciuto #%d",PlayerAccount[i][ID]); } UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0xFF5000FF, namedstring); SetPlayerHealth(i, health-1); PlayerActionMessage(i,15.0,"non sta bene."); SetPlayerDrunkLevel(i, 5000);} } else if (health <= 30.0 && Antidolor[i] == 0) { if(random(1)==0){ if(!IsPlayerInAnyVehicle(i)) { ApplyAnimation(i,"CRACK","crckdeth2",4.1,0,1,1,1,1,1); } if(PlayerAccount[i][wearingmask] == 1){ format(namedstring, sizeof(namedstring), "Sconosciuto #%d",PlayerAccount[i][ID]); } UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0xFF1400FF, namedstring); SetPlayerHealth(i, health-2.5); PlayerActionMessage(i,15.0,"non sta bene."); SetPlayerDrunkLevel(i, 10000);} } if(ADuty[i]) { format(namedstring, sizeof(namedstring), "Admin %s", PlayerAccount[i][Name]); UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0x5189F0FF, namedstring); } else if(HelperDuty[i]) { format(namedstring, sizeof(namedstring), "Helper %s", PlayerAccount[i][Name]); UpdateDynamic3DTextLabelText(PlayerAccount[i][pnlabel], 0x91FFADFF, namedstring); } } }