Player name weird problem
#1

Hello guys

Im having a weird problem on my gamemode. I have a command which can add something infront of your name ingame, like if I do " /tag tagtest" my name will display like tagtestMYNICKNAME in the chat. The tag is stored into the user file so it remains when someone reconnects.
Let me do an example of my problem:

If someones id 4 and does /tag hes fine, the tag works, even after he relogs, but later on, after some other person joins with the same id, the tag will also appear at the new player, even if he didnt do it. It happens for all ids.

Please help me, any ideas what could cause it? Its like the server would cache some of the settings and stick it with a new player after relog on the same id.


Also, I had a duel system.. After someone offered someone a duel, the name vs name worked fine, but after one of the players logged out and someone else joined, and someone dueled him, the name vs name stayed the same with the same name.


Thanks alot
Reply
#2

Reset it at OnPlayerConnect Callback.
pawn Код:
// Example:
public OnPlayerConnect( playerid )
{
    // The Variable Here Ex:
    PlayerInfo[ playerid ][ TAG ] = 0; // Just an example
    // Rest
    return 1;
}
So, you will prevent the next player with the same id has the tag because you have reset it.
Reply
#3

Seems like it worked, thank But what about the duel system? Its mistaking the user names..
Reply
#4

Explain more what happened with the user names on duel system, if you don't mind.
Reply
#5

After I load the duel filterscript and someone does " /duel id id " it will show a duel has started ( name vs name ) everything works fine. After one of the players disconnect and someone else joins instead of him into the previous player id, and someone makes a duel with the id again, it will still be " a duel has started name vs name" but the name is the old player name, not the new player name. Not sure if I explained it right, but basically, it will remember the previous playername and wont switch it the new playername. Weird
Reply
#6

Quote:
Originally Posted by Orpheus255
Посмотреть сообщение
After I load the duel filterscript and someone does " /duel id id " it will show a duel has started ( name vs name ) everything works fine. After one of the players disconnect and someone else joins instead of him into the previous player id, and someone makes a duel with the id again, it will still be " a duel has started name vs name" but the name is the old player name, not the new player name. Not sure if I explained it right, but basically, it will remember the previous playername and wont switch it the new playername. Weird
Do a check if the playerid's tag is already stored, if it is reset it.

pawn Код:
enum pInfo
{
     Username[25],
     Tag[MAX_TAG_SIZE] = 0,
}

new PlayerInfo[MAX_PLAYERS][pInfo];

public OnPlayerConnect(playerid)
{
     //GetPlayerName(playerid, PlayerInfo[playerid][Username], 25);
     
     if(PlayerInfo[playerid][Tag] != 0) PlayerInfo[playerid][Tag] = 0; // Change to whatever variable tag is stored in.
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)