Necessary for IsPlayerConnected?
#1

I've noticed that many people use if(IsPlayerConnected(playerid) under many general callbacks.

Is that even necessary?

ie:
OnPlayerText
OnPlayerCommandText
...and others
Reply
#2

Nah, that's retarded. GF does that checks and because whoever uses GF also do that. How the fuck can player trigger a callback if he/she isn't connected?
Reply
#3

Quote:
Originally Posted by $ЂЯĢ
Nah, that's retarded. GF does that checks and because whoever uses GF also do that. How the fuck can player trigger a callback if he/she isn't connected?
Lol I know. It gets pretty annoying seeing that. There wouldn't be as many problems with people's script if they used some common sense and actually thought for a second.
Reply
#4

Lol

When would you properly use it?
Reply
#5

Simple checking:
pawn Code:
new
  id;

if(unformat(params, "r", id)) return ...;
else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR, "The requested player is not connected..."); // HERE :D
Reply
#6

@SAVC,
Code:
else if(if == INVLAID_PLAYER_ID)
This would be better way to check that since sscanf returns INVALID_PLAYER_ID if player isn't connected.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)