Player not connected bug -
Stevo127 - 27.07.2013
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.
Re: Player not connected bug -
Vanter - 27.07.2013
post your command?
Re: Player not connected bug -
Stevo127 - 27.07.2013
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
Re: Player not connected bug -
Stevo127 - 27.07.2013
However ill post a command later when i get on my computer
Re: Player not connected bug -
Stevo127 - 27.07.2013
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;
}
Re: Player not connected bug -
MellowHammer - 27.07.2013
Does it work when you type the name from its beginning?
Re: Player not connected bug -
Stevo127 - 27.07.2013
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.
Re: Player not connected bug -
Konstantinos - 27.07.2013
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.
Re: Player not connected bug -
Stevo127 - 27.07.2013
That's because I removed the message. If you had have read that, you would have seen that I did already lol
Re: Player not connected bug -
Stevo127 - 27.07.2013
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;
}