3D Text Ranks [Help]
#1

Guys, I created some 3D Ranks, and attached em to players. I attach them based on ranges of score at OnPlayerSpawn.

At OnPlayerDeath I delete all the 3D text's cause then the player will just respawn and it will be reapplied due to the configuration at OnPlayerSpawn but the problem is,

For example, Player A and Player B, both have 3d Ranks displayed above their head. Let us say, Player B kills player A and player A respawns. Player B is able to see Player's A 3D text but Player A is unable to see Player B's text. Player A then kills Player B and after Player B respawns, Player A is able to see Player B's 3D text but Player B is unable to see A's unless he kills him and basically its a vice versa.....

Now how to I complete this problem? +REP...
Reply
#2

What's wrong with creating 3D text on connect and showing it on spawn? Should be a lot easier than to delete and create them each time. Plus without code, nobody can guess why that's happening.
Reply
#3

I put 3dtexts on everyone... Being that they are of use in so many situations, cars, players, NPCs, pickups, checkpoints should all almost have accompanying 3dtexts, even if they are empty.
Reply
#4

Quote:
Originally Posted by Cypress
Посмотреть сообщение
What's wrong with creating 3D text on connect and showing it on spawn? Should be a lot easier than to delete and create them each time. Plus without code, nobody can guess why that's happening.
Hmm, fair enough. How can people help without the code. I'll post it below.

OnPlayerSpawn
Код:
if(GetPlayerScore(playerid)  > 12000)
    {
      if(GetPlayerTeam(playerid) == 2 || GetPlayerTeam(playerid) == 9 || GetPlayerTeam(playerid) == 13)
      {
        SetPlayerWantedLevel(playerid, 6);
        TextDrawShowForPlayer(playerid, Level 6 (Cops));
        level6 = Create3DTextLabel("Level 6 (Cops)", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level6, playerid, 0.0, 0.0, 0.5);
	  }
	  else
	  {
        SetPlayerWantedLevel(playerid, 6);
        TextDrawShowForPlayer(playerid, Level 6);
        level6i = Create3DTextLabel("Level 6", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level6i, playerid, 0.0, 0.0, 0.5);
      }
	}
    else if(GetPlayerScore(playerid)  > 8000)
    {
	  if(GetPlayerTeam(playerid) == 2 || GetPlayerTeam(playerid) == 9 || GetPlayerTeam(playerid) == 13)
      {
        SetPlayerWantedLevel(playerid, 5);
        TextDrawShowForPlayer(playerid, Level 5 (Cops));
        level5= Create3DTextLabel("Level 5 (Cops)", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level5, playerid, 0.0, 0.0, 0.5);
	  }
	  else
	  {
        SetPlayerWantedLevel(playerid, 5);
        TextDrawShowForPlayer(playerid, Level5);
        level5i = Create3DTextLabel("Level5", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level5i, playerid, 0.0, 0.0, 0.5);
      }
	}
    else if(GetPlayerScore(playerid)  > 6500)
    {
	  if(GetPlayerTeam(playerid) == 2 || GetPlayerTeam(playerid) == 9 || GetPlayerTeam(playerid) == 13)
      {
        SetPlayerWantedLevel(playerid, 4);
        TextDrawShowForPlayer(playerid, Level4(Cops));
        level4= Create3DTextLabel("Level 4(Cops)", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level4, playerid, 0.0, 0.0, 0.5);
	  }
	  else
	  {
        SetPlayerWantedLevel(playerid, 4);
        TextDrawShowForPlayer(playerid, Level4);
        level4i= Create3DTextLabel("Level4", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level4i, playerid, 0.0, 0.0, 0.5);
      }
	}
	else if(GetPlayerScore(playerid)  > 3500)
    {
	  if(GetPlayerTeam(playerid) == 2 || GetPlayerTeam(playerid) == 9 || GetPlayerTeam(playerid) == 13)
      {
        SetPlayerWantedLevel(playerid, 3);
        TextDrawShowForPlayer(playerid, Level3(Cops));
        level3= Create3DTextLabel("Level3(Cops)", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level3, playerid, 0.0, 0.0, 0.5);
	  }
	  else
	  {
        SetPlayerWantedLevel(playerid, 3);
        TextDrawShowForPlayer(playerid, Level3);
        level3i= Create3DTextLabel("Level3", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level3i, playerid, 0.0, 0.0, 0.5);
      }
	}
	else if(GetPlayerScore(playerid)  > 1500)
    {
	  if(GetPlayerTeam(playerid) == 2 || GetPlayerTeam(playerid) == 9 || GetPlayerTeam(playerid) == 13)
      {
        SetPlayerWantedLevel(playerid, 2);
        TextDrawShowForPlayer(playerid, Level2(Cops));
        level2= Create3DTextLabel("Level2(Cops)", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level2, playerid, 0.0, 0.0, 0.5);
	  }
	  else
	  {
        SetPlayerWantedLevel(playerid, 2);
        TextDrawShowForPlayer(playerid, Level2);
        level2i= Create3DTextLabel("Level2", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level2i, playerid, 0.0, 0.0, 0.5);
      }
	}
	else if(GetPlayerScore(playerid)  > 500)
    {
	  if(GetPlayerTeam(playerid) == 2 || GetPlayerTeam(playerid) == 9 || GetPlayerTeam(playerid) == 13)
      {
        SetPlayerWantedLevel(playerid, 1);
        TextDrawShowForPlayer(playerid, Level1(Cops));
        level1= Create3DTextLabel("Level1(Cops)", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level1, playerid, 0.0, 0.0, 0.5);
	  }
	  else
	  {
        SetPlayerWantedLevel(playerid, 1);
        TextDrawShowForPlayer(playerid, Level1);
        level1i= Create3DTextLabel("Level1", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level1i, playerid, 0.0, 0.0, 0.5);
      }
	}
    else
    {
      if(GetPlayerTeam(playerid) == 2 || GetPlayerTeam(playerid) == 9 || GetPlayerTeam(playerid) == 13)
      {
        TextDrawShowForPlayer(playerid, Level0(Cops));
        SetPlayerWantedLevel(playerid, 0);
        level0= Create3DTextLabel("Level 0(Cops)", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level0, playerid, 0.0, 0.0, 0.5);
	  }
	  else
	  {
        TextDrawShowForPlayer(playerid, Level0);
        SetPlayerWantedLevel(playerid, 0);
        level0i= Create3DTextLabel("Level0", GetPlayerColor(playerid) , 30.0, 40.0, 50.0, 40.0, 0);
	    Attach3DTextLabelToPlayer(level0i, playerid, 0.0, 0.0, 0.5);
      }
	}
OnPlayerDeath
Код:
	Delete3DTextLabel(Text3D:level0);
	Delete3DTextLabel(Text3D:level1);
	Delete3DTextLabel(Text3D:level2);
	Delete3DTextLabel(Text3D:level3);
	Delete3DTextLabel(Text3D:level4);
	Delete3DTextLabel(Text3D:level5);
	Delete3DTextLabel(Text3D:level6);
	Delete3DTextLabel(Text3D:level0i);
	Delete3DTextLabel(Text3D:level1i);
	Delete3DTextLabel(Text3D:level2i);
	Delete3DTextLabel(Text3D:level3i);
	Delete3DTextLabel(Text3D:level4i);
	Delete3DTextLabel(Text3D:level5i);
	Delete3DTextLabel(Text3D:level6i);
The reason why I don't use it at OnPlayerConnect is for the reason, that let us consider a Player ranking from 1 suddenly changes to Rank 2, it will display 2 texts instead. That's why I delete them each time they die and reapply it at Spawn, so in a way it updates it but the problem is like I mentioned earlier. It works, but it won't display the tag of a killer, but it will only after he respawns..... I want it to display everytime, even when the victim has died and respawned, his killer's tag should be visible.... without the killer having to respawn in order for it to show....
Reply
#5

This is a very complicated script you have. I'd do it with arrays and use only one 3d text for every level available, updating it only. That should skip the need of having 20 different 3d text labels for each level. If you could wait a bit, I can make that code for you just as a functioning example, only later today or tomorrow since I don't have much time right now. Apologies for the unhelpful reply.

Also I don't understand why the first level is called rank and the others rank and not level.
Reply
#6

Quote:
Originally Posted by Cypress
Посмотреть сообщение
This is a very complicated script you have. I'd do it with arrays and use only one 3d text for every level available, updating it only. That should skip the need of having 20 different 3d text labels for each level. If you could wait a bit, I can make that code for you just as a functioning example, only later today or tomorrow since I don't have much time right now. Apologies for the unhelpful reply.
Yea, that would be great. I can wait. Thank you.

Sorry, typo mistake about the Rank 0.... XD
Reply
#7

Quote:
Originally Posted by Sting.
Посмотреть сообщение
The reason why I don't use it at OnPlayerConnect is for the reason, that let us consider a Player ranking from 1 suddenly changes to Rank 2, it will display 2 texts instead. That's why I delete them each time they die and reapply it at Spawn, so in a way it updates it but the problem is like I mentioned earlier. It works, but it won't display the tag of a killer, but it will only after he respawns..... I want it to display everytime, even when the victim has died and respawned, his killer's tag should be visible.... without the killer having to respawn in order for it to show....
You really shouldn't need to do this, unless you have issues elsewhere that are adding to this.
Reply
#8

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
You really shouldn't need to do this, unless you have issues elsewhere that are adding to this.
Hmm, Sew_Sumi. You're right. I'll rechange the whole thing with the help of Cypress.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)