Player not connected bug
#1

Its strange, only started happening recently, where all of a sudden a player will become bugged and either it doesnt display their username in a command such as /players, or you try and message them with a command such as /pm id message, and it will say 'player is not connected'.

Using ZCMD, latest sscanf and simple IsPlayerConnected checks.
Reply
#2

post your command?
Reply
#3

Its not a command problem, it works fine 90% of the time and its been workin for the past year and a half, its also across multiple commands, and seems to be an issue with IsPlayerConnected
Reply
#4

However ill post a command later when i get on my computer
Reply
#5

For example, here's one of the basic commands which sometimes does not work, even with the player 100% IS Connected to the server. It takes the name string, runs it through sscanf with the parameter of Playername/ID, and sets it to giveplayerid.

If I had a !IsPlayerConnected(giveplayerid) in there, it would say Player is not connected. When they DEFINITELY are connected to the server. Without this line, which was my attempt to fix, it just says UNKNOWN COMMAND instead.

pawn Код:
CMD:id(playerid, params[])
{
    new string[128], giveplayerid;
    if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /id [playerid/PartOfName]");
    else
    {
        format(string, sizeof(string), "(ID: %d) - (Name: %s) - (Level: %d) - (Ping: %d)", giveplayerid, GetPlayerNameEx(giveplayerid),  PlayerInfo[giveplayerid][pLevel], GetPlayerPing(giveplayerid));
        SendClientMessageEx(playerid, COLOR_WHITE, string);
    }
    return 1;
}
Reply
#6

Does it work when you type the name from its beginning?
Reply
#7

Nothing wrong with the partial check. Just sometimes says Player is not connected, when the DEFINITELY are connected. Problem is, its very frequent cause we have around 200 players. Which is a damn nuisance.
Reply
#8

Quote:
Originally Posted by Stevo127
Посмотреть сообщение
Nothing wrong with the partial check. Just sometimes says Player is not connected, when the DEFINITELY are connected. Problem is, its very frequent cause we have around 200 players. Which is a damn nuisance.
I don't see any message like that on the command above.
Reply
#9

That's because I removed the message. If you had have read that, you would have seen that I did already lol
Reply
#10

It was like this before I removed the message.

pawn Код:
CMD:id(playerid, params[])
{
    new string[128], giveplayerid;
    if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /id [playerid/PartOfName]");
    else if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GRAD2, "That player is not found.");
    else
    {
        format(string, sizeof(string), "(ID: %d) - (Name: %s) - (Level: %d) - (Ping: %d)", giveplayerid, GetPlayerNameEx(giveplayerid),  PlayerInfo[giveplayerid][pLevel], GetPlayerPing(giveplayerid));
        SendClientMessageEx(playerid, COLOR_WHITE, string);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)