[HELP] Re-set players name when Disconnect
#1

ive got code that adds a tag to a players name (thanks WrathOfGenesis), but when my game mode re-starts the tag stays there and causes players to have multiple tags...
any way i can put something in OnPlayerDisconnect to disconnect the player completely then re-join or something so their name re-sets?
Reply
#2

Loop through players in OnGameModeExit
Reply
#3

Can you post your tagscript?
I tink its something like
OnPlayerDisconnect(playerid)
{
playertag[playerid] = "";
}
Reply
#4

um ok the script is:
Код:
stock GivePlayerTag ( playerid , tag [ ] )
{
  new name [ MAX_PLAYER_NAME ];
  new newname [ 30 ];

  GetPlayerName ( playerid , name , MAX_PLAYER_NAME );

  format ( newname , sizeof ( newname ) , "[%s]%s" , tag , name );

  SetPlayerName ( playerid , newname );

  return 1;
}
public OnPlayerSpawn(playerid)
{
  // First we need to see what classid a player got
  switch(gClass[playerid])
  {
    case 0,1,2,3,4,5,6,7,8,9,10:
    {
      SetPlayerColor(playerid, 0xFF6600AA); // Orange
      GivePlayerTag ( playerid , "THIS" );
    }
    case 11,12,13,14,15,16,17,18,19,20,21,22:
    {
      SetPlayerColor(playerid, 0xFF0000AA); // Red
    	GivePlayerTag ( playerid , "IS" );
    }
    case 23,24,25,26,27,28,29,30,31:
    {
      SetPlayerColor(playerid, 0x0066FFAA); // blue
      GivePlayerTag ( playerid , "RANDOM" );
    }
  }
  return 1;
}
i changed the tag names cause i dont want to give them away... um...
anyway...
ill try that.
Reply
#5

=(
didnt work...
maybe wrong spelling?
idk
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)