Problem with IsPlayerConnected
#1

Hey,

I have a weird problem with IsPlayerConnected, everytime a playerid crashes from the server that ID becomes unusable. It keeps saying invalid player ID, I have a solution for it but I don't know if it's the right way or if it has consequences to it.

This is what I have originally
Код:
if(!IsPlayerConnected(playerb)) return SendClientMessage(playerid, COLOR_ORANGE, "** {AFAFAF}Invalid player ID.");
Tried this, doesn't work either.
Код:
if(playerb == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_ORANGE, "** {AFAFAF}Invalid player ID.");
It only worked when I changed the sscanf from this:
Код:
if(sscanf(params, "u", playerb))

//To

if(sscanf(params, "i", playerb))
I know that "u" is for player ID's but it doesn't work properly for me. My question is, is there another solution or can I keep doing that without any problems or consequences?
Reply
#2

It can take up to a minute for the server to release the id of a crashed player. There's nothing you can do about that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)