onplayerconnect
#1

Hi,

I need to do checks like that

if( playerid == -1 ) ?

or this never hapin?
Reply
#2

OnPlayerConnect is called when (obviously) a player connects. It's impossible for a playerid to be -1.

What're you trying to check?
Reply
#3

Maybe there is hacks, that could
Reply
#4

No. How would that even work? A playerid can't be below 0.
Reply
#5

You should check INVALID_PLAYER_ID not -1.
Reply
#6

Quote:
Originally Posted by OneDay
Посмотреть сообщение
You should check INVALID_PLAYER_ID not -1.
or if(IsPlayerConnected(playerid))
Reply
#7

So when onplayerconnected is called IsPlayerConnected have always be true?
Reply
#8

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

So i need to check

Код:
public OnPlayerConnect( playerid )
{
if( !IsPlayerConnected( playerid ) )
{
return 1;
}
return 1;
}
Reply
#10

And is possible that when onplayerconnect player instantly disconnect onplayerrequestclass still get called or no?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)