onplayerconnect - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: onplayerconnect (
/showthread.php?tid=638193)
onplayerconnect -
Bussyman - 28.07.2017
Hi,
I need to do checks like that
if( playerid == -1 ) ?
or this never hapin?
Re: onplayerconnect -
Kane - 28.07.2017
OnPlayerConnect is called when (obviously) a player connects. It's impossible for a playerid to be -1.
What're you trying to check?
Re: onplayerconnect -
Bussyman - 28.07.2017
Maybe there is hacks, that could
Re: onplayerconnect -
Kane - 28.07.2017
No. How would that even work? A playerid can't be below 0.
Re: onplayerconnect -
OneDay - 28.07.2017
You should check INVALID_PLAYER_ID not -1.
Re: onplayerconnect -
HoussamMaroc - 28.07.2017
Quote:
Originally Posted by OneDay
You should check INVALID_PLAYER_ID not -1.
|
or if(IsPlayerConnected(playerid))
Re: onplayerconnect -
Bussyman - 28.07.2017
So when onplayerconnected is called IsPlayerConnected have always be true?
Re: onplayerconnect -
Xeon™ - 28.07.2017
Quote:
Originally Posted by Bussyman
So when onplayerconnected is called IsPlayerConnected have always be true?
|
Yes, excalty.
but you should know that OnPlayerConnect isnt the first callback that get called when a player trying to connect
https://sampwiki.blast.hk/wiki/OnIncomingConnection is the first callback.
Re: onplayerconnect -
Bussyman - 29.07.2017
So i need to check
Код:
public OnPlayerConnect( playerid )
{
if( !IsPlayerConnected( playerid ) )
{
return 1;
}
return 1;
}
Re: onplayerconnect -
Bussyman - 29.07.2017
And is possible that when onplayerconnect player instantly disconnect onplayerrequestclass still get called or no?