SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 08/07/2016, 03:05 PM   #1
Problems
Big Clucker
 
Join Date: Sep 2013
Posts: 136
Reputation: 1
Default Player isn't connected problem

I use this under the commands
Code:
if(ID == INVALID_PLAYER_ID)
	{
	    format(string,sizeof(string),"{808080}[SERVER]{FFFFFF} The Player ID (%d) is not connected to the server.",ID);
	    SendClientMessage(playerid,COLOR_WHITE,string);
	    return 1;
	}
But with some IDs[Most IDs] it keeps say this while the players are connected.
Problems is offline   Reply With Quote
Old 08/07/2016, 03:50 PM   #2
Problems
Big Clucker
 
Join Date: Sep 2013
Posts: 136
Reputation: 1
Default Re: Player isn't connected problem

I really need this urgently so sorry for bumping.
Problems is offline   Reply With Quote
Old 08/07/2016, 03:52 PM   #3
Dusan01
Huge Clucker
 
Dusan01's Avatar
 
Join Date: Jul 2011
Location: Republika Srpska, Prijedor
Posts: 484
Reputation: 42
Default Re: Player isn't connected problem

try using it like this:
PHP Code:
if(!IsPlayerConnected(ID))
    {
        
format(string,sizeof(string),"{808080}[SERVER]{FFFFFF} The Player ID (%d) is not connected to the server.",ID);
        
SendClientMessage(playerid,COLOR_WHITE,string);
        return 
1;
    } 
__________________

My Bike KTM 450 SXF 2008


REP+ IF I HELPED!
Dusan01 is offline   Reply With Quote
Old 08/07/2016, 04:18 PM   #4
Problems
Big Clucker
 
Join Date: Sep 2013
Posts: 136
Reputation: 1
Default Re: Player isn't connected problem

I think there is a problem in such a plugin maybe?
Problems is offline   Reply With Quote
Old 08/07/2016, 05:18 PM   #5
Sjn
Huge Clucker
 
Join Date: Jul 2015
Location: Nepal
Posts: 349
Reputation: 50
Default Re: Player isn't connected problem

I experienced this once few years back, found out it was caused by the outdated sscanf include/plugin. If you aren't using the latest version, try updating it, maybe?
Sjn is offline   Reply With Quote
Old 08/07/2016, 07:03 PM   #6
Problems
Big Clucker
 
Join Date: Sep 2013
Posts: 136
Reputation: 1
Default Re: Player isn't connected problem

I updated to this but still also sometimes there are problems with IDs that says they aren't connected
Problems is offline   Reply With Quote
Old 08/07/2016, 08:13 PM   #7
ReshiramZekrom
Big Clucker
 
ReshiramZekrom's Avatar
 
Join Date: May 2012
Location: Bari, Italy
Posts: 132
Reputation: 14
Default Re: Player isn't connected problem

Did you introduce something new into your gamemode recently? Or did you load a new fs?
__________________
ReshiramZekrom is offline   Reply With Quote
Old 08/07/2016, 08:39 PM   #8
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,571
Reputation: 187
Default Re: Player isn't connected problem

Did you try what Dusan01 said?

INVALID_PLAYER_ID = 65535

Even if ID 5 (for example) isn't online, 5 will never be equal to 65535.
Stinged is offline   Reply With Quote
Old 08/07/2016, 08:59 PM   #9
Problems
Big Clucker
 
Join Date: Sep 2013
Posts: 136
Reputation: 1
Default Re: Player isn't connected problem

Quote:
Originally Posted by Stinged View Post
Did you try what Dusan01 said?

INVALID_PLAYER_ID = 65535

Even if ID 5 (for example) isn't online, 5 will never be equal to 65535.
Is that after a new update or something? Cause it used to work before
Problems is offline   Reply With Quote
Old 08/07/2016, 09:20 PM   #10
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,571
Reputation: 187
Default Re: Player isn't connected problem

Which specifier are you using (u, r, i..)

I just tested the "u" and "r" specifier, and it seems that they set the variable value as INVALID_PLAYER_ID if the ID isn't connected.
But if you're using the "i" specifier, then it won't return the value as 65535.
Stinged is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Player is not connected problem. gtasarules14 Scripting Help 13 29/07/2014 04:47 AM
[BUG] Player not connected rhaskos Server Support 5 28/11/2013 08:39 PM
Player Is Not connected Bug Mike97300 Scripting Help 9 12/06/2012 11:08 PM
Player not connected ArmyOps Scripting Help 12 04/03/2012 09:06 PM
player is not connected? Seven. Help Archive 3 21/09/2010 03:13 PM


All times are GMT. The time now is 06:05 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.