ID's are messed up in the server.
#1

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?
Reply
#2

Can you show me one command?
Reply
#3

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!"
Reply
#4

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;
}
Reply
#5

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.
Reply
#6

Any ideas? The problem still persists..
Reply
#7

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.
Reply
#8

Checked it and somehow it says that player is not online. So in other words, its same.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)