ID's are messed up in the server. -
Tamer - 18.10.2013
Hey,
Since a few weeks, specific ID's on my server are bugged, whenever I try using a command, it keeps saying "Player is not connected."
pawn Код:
else if (ID==INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_WHITE,"Error: Player is not connected!");
I have this ID problem on all commands, not only on a specific command. I read that it's a sscanf issue and I updated my SSCANF plugin and include. Didn't work.
The ID's that are bugged are random, they change after every restart, I think relogging fixes it aswell, but I'm not sure. Kicking via RCON works fine, since it's implemented to SA-MP and has nothing to do with SSCANF.
Not very far, back like in 3-4 months ago I had the same issue, I had added a few commands by in mistake, I screwed few things, but I easily fixed it by rolling-back by commands.
Now I did the same, but the ID's are still bugged and ideas what can be the reason beneath this?
Re: ID's are messed up in the server. -
Chrillzen - 18.10.2013
Can you show me one command?
Re: ID's are messed up in the server. -
Tamer - 18.10.2013
pawn Код:
CMD:somecommand(playerid,params[])
{
new id;
if(sscanf(params, "u", id))SendClientMessage(playerid, -1, "Usage: /somecommand [id/name]");
if(id==INVALID_PLAYER_ID)SendClientMessage(playerid,-1,"Error: Player is not connected!");
PlayAudioStreamForPlayer(id,"www.******.com");
return 1;
}
Here's one that doesn't work, main idea is this. It does send the Stream, but at some ID's it says "Player is not connected!"
Re: ID's are messed up in the server. -
Chrillzen - 18.10.2013
Hmmm... try this?
pawn Код:
CMD:somecommand(playerid,params[])
{
new id;
if(sscanf(params,"u", id)) return SendClientMessage(playerid, -1,"Usage: /somecommand [playerid/partofname] ");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-1,"Error: Player is not connected!");
PlayAudioStreamForPlayer(id,"www.******.com");
return 1;
}
Re: ID's are messed up in the server. -
Tamer - 18.10.2013
Even if I put the return there, shouldn't the command work? Well let me check thought. This command is like that, let me check the others.
Edit: It's same, still doesn't work.
Re: ID's are messed up in the server. -
Tamer - 19.10.2013
Any ideas? The problem still persists..
Re: ID's are messed up in the server. -
-Prodigy- - 19.10.2013
Try this:
pawn Код:
CMD:test(playerid, params[])
{
if(isnull(params)) return SendClientMessage(playerid, -1, "Usage: /test <playerid>");
new id = strval(params);
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "User is not online");
PlayerAudioStreamForPlayer(id, "..");
return 1;
}
If that works, then you do not have the latest version of sscanf.
Re: ID's are messed up in the server. -
Tamer - 26.10.2013
Checked it and somehow it says that player is not online. So in other words, its same.